gembank_client 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # GemBank-Client is a command line utility for managing Gems on http://gembank.org
1
+ # GemBank-Client is a command line utility for managing Gems on https://gembank.org
2
2
 
3
3
 
4
4
  ## Installation
@@ -22,10 +22,10 @@ $ gem install gembank_client
22
22
  ### Creating / Updating Gems
23
23
 
24
24
  ```bash
25
- $ gembank_client release -k c93a3fcd6720bf27b53801d8d7fbc7fa7747df60 -f superman-1.2.3.gem
25
+ $ gembank release c93a3fcd6720bf27b53801d8d7fbc7fa7747df60 superman-1.2.3.gem
26
26
  ```
27
27
 
28
- * The SHA1 is the Push-Key allowed to write to GemBucket `superman`. See http://gembank.org/how-does-it-work for details.
28
+ * The SHA1 is the Push-Key allowed to write to GemBucket `superman`. See https://gembank.org/how-does-it-work for details.
29
29
  * The file is the Gem you want to create / update.
30
30
 
31
31
  ### Yanking Gems will follow ASAP.
File without changes
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'gembank_client/cli'
4
+
5
+ GembankClient::CLI.start(ARGV)
@@ -11,8 +11,8 @@ Gem::Specification.new do |gem|
11
11
  gem.files = `git ls-files`.split("\n")
12
12
  gem.require_paths = %w[lib]
13
13
  gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
14
- gem.add_dependency('choice')
15
14
  gem.add_dependency('rest-client')
15
+ gem.add_dependency('thor')
16
16
  gem.add_development_dependency('pry')
17
17
  gem.add_development_dependency('rake')
18
18
  gem.add_development_dependency('rspec')
@@ -1,4 +1,2 @@
1
- require 'gembank_client/cli'
2
-
3
1
  module GembankClient
4
2
  end
@@ -1,50 +1,14 @@
1
- require 'choice'
2
- require 'gembank_client/resource'
3
1
  require 'singleton'
2
+ require 'thor'
4
3
 
5
- module GembankClient
6
- class CLI
7
- include Singleton
8
-
9
- def self.run
10
- instance.run
11
- end
12
-
13
- def run
14
- Choice.options do
15
- banner('Usage: gembank_client ACTION --key=KEY --file=GEM_FILE [--url=URL]')
16
- header('Available actions: release')
17
- header('Options:')
18
- option(:key, :required => true) do
19
- short('-k')
20
- long('--key=KEY')
21
- desc('Push key (required)')
22
- end
23
- option(:file, :required => true) do
24
- short('-f')
25
- long('--file=FILE')
26
- desc('Gem file (required)')
27
- end
28
- option(:url) do
29
- short('-u')
30
- long('--url=URL')
31
- desc('Gembank URL')
32
- end
33
- end
34
-
35
- action = ARGV.first
36
- puts(Choice.help) unless action
37
-
38
- resource = GembankClient::Resource.new(Choice.choices[:key], Choice.choices[:file],
39
- Choice.choices[:url])
4
+ require 'gembank_client/resource'
40
5
 
41
- case action
42
- when 'release'
43
- resource.release
44
- else
45
- puts("Unknown action '#{action}'\n")
46
- puts(Choice.help)
47
- end
6
+ module GembankClient
7
+ class CLI < Thor
8
+ desc('release KEY FILE', 'Release FILE using KEY')
9
+ method_option(:url, :default => 'https://gembank.org')
10
+ def release(key, file)
11
+ GembankClient::Resource.new(key, file, options[:url]).release
48
12
  end
49
13
  end
50
14
  end
@@ -2,9 +2,7 @@ require 'rest_client'
2
2
 
3
3
  module GembankClient
4
4
  class Resource
5
- DEFAULT_URL = 'https://gembank.org'
6
-
7
- def initialize(key, file, url = DEFAULT_URL)
5
+ def initialize(key, file, url)
8
6
  @key, @file, @url = key, file, url
9
7
  end
10
8
 
@@ -1,3 +1,3 @@
1
1
  module GembankClient
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gembank_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,10 +9,10 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-23 00:00:00.000000000 Z
12
+ date: 2012-05-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: choice
15
+ name: rest-client
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
@@ -28,7 +28,7 @@ dependencies:
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
30
  - !ruby/object:Gem::Dependency
31
- name: rest-client
31
+ name: thor
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
@@ -97,8 +97,8 @@ description: ! 'CL Client for gembank.org
97
97
  email:
98
98
  - info@gembank.org
99
99
  executables:
100
- - gb-cli
101
- - gembank_client
100
+ - gb
101
+ - gembank
102
102
  extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
@@ -110,8 +110,8 @@ files:
110
110
  - README.md
111
111
  - README.txt
112
112
  - Rakefile
113
- - bin/gb-cli
114
- - bin/gembank_client
113
+ - bin/gb
114
+ - bin/gembank
115
115
  - gembank_client.gemspec
116
116
  - lib/gembank_client.rb
117
117
  - lib/gembank_client/cli.rb
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'gembank_client'
4
-
5
- GembankClient::CLI.run