Skip to content

Commit

Permalink
Added gem to RubyGems.org
Browse files Browse the repository at this point in the history
  • Loading branch information
tenfensw committed Jul 21, 2019
1 parent 35f140c commit 21fa1ce
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DialogBind is a library wrapping around message box displaying tools (zenity and

## A simple example
```
require_relative 'dialogbind'
require 'dialogbind'
if guiyesno('Would you like me to show you a random number?', 'Message') == false then
guierror('You have selected no.')
Expand All @@ -15,14 +15,14 @@ end
This tiny program in Ruby will show a question dialog with yes and no buttons, with title "Message" and text "Would you like me to show you a random number?". That dialog will return either true if yes was clicked, otherwise, it returns false. If false is returned, an error with text "You have selected no." pops up. Otherwise, a random number from 0 to 19 is generated and is displayed in an information message box with title "Your random number".

## Installing
Currently, there is no RubyGems package, so the only way is to bundle it with your application. So you should fetch it to the folder containing the sources of your application, like this:
Install RubyGem:
```
curl https://gitlab.com/timkoi/dialogbind/raw/master/dialogbind.rb > dialogbind.rb
sudo gem install dialogbind
```

And then include it the following way:
And then include it in your Ruby code the following way:
```
require_relative 'dialogbind'
require 'dialogbind'
```

That's it! You can use it from your code, but it will only work on Linux, macOS and FreeBSD. Other platforms are not supported right now.
Expand Down
15 changes: 15 additions & 0 deletions dialogbind.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'rubygems'

Gem::Specification.new do |gemdesc|
gemdesc.name = 'dialogbind'
gemdesc.version = '0.9.1'
gemdesc.author = [ 'Tim K' ]
gemdesc.email = [ '[email protected]' ]
gemdesc.date = '2019-07-21'
gemdesc.homepage = 'https://gitlab.com/timkoi/dialogbind'
gemdesc.summary = 'DialogBind provides a Ruby API that wraps around Linux and macOS message box-generating tools.'
gemdesc.files = [ 'lib/dialogbind.rb' ]
gemdesc.required_ruby_version = Gem::Requirement.new('>= 2.0.0')
gemdesc.require_paths = [ 'lib' ]
gemdesc.licenses = [ 'MIT' ]
end
1 change: 1 addition & 0 deletions dialogbind.rb → lib/dialogbind.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Licensed under MIT License.

$dialogbind_macos_script_cmd = ''
$dialogbind_version = '0.9.1'

def zenity(arg)
args_total = ''
Expand Down

0 comments on commit 21fa1ce

Please sign in to comment.