appraiser 0.1.4 → 0.1.5

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.
@@ -0,0 +1,17 @@
1
+ == 0.1.5
2
+
3
+ * gem commandify [amatsuda]
4
+ The CLI command moved to a Rubygems' subcommand.
5
+ example:
6
+ (basic)
7
+ $ gem appraiser
8
+
9
+ (shorthand)
10
+ $ gem a
11
+
12
+ ("group" option)
13
+ $ gem a -g test
14
+
15
+ == 0.1.4
16
+
17
+ * First release
data/README.md CHANGED
@@ -1,30 +1,34 @@
1
- Appraiser = a simple command line utility for Gemfile
2
- =====================================================
1
+ Appraiser = a simple rubygems subcommand for Gemfile
2
+ ====================================================
3
3
 
4
4
  `appraiser` displays gem information from `./Gemfile`.
5
5
 
6
6
  Like this:
7
7
 
8
- ![Screenshot](http://farm6.static.flickr.com/5026/5643970264_2b995ed4b1.jpg)
8
+ ![Screenshot](http://farm6.static.flickr.com/5263/5650073256_6ed10dc831_o.png)
9
9
 
10
10
 
11
11
  Install
12
12
  -------
13
13
 
14
+ appraiser installed as a rubygems subcommand.
15
+
14
16
  $ gem install appraiser
17
+ $ gem help commands | grep appraiser
18
+ appraiser Display gem information in ./Gemfile
15
19
 
16
20
 
17
21
  Usage
18
22
  -----
19
23
 
20
- Appraiser normally displays runtime dependencies.
24
+ Normally displays runtime dependencies.
21
25
 
22
26
  $ cd /path/to/project_with_Gemfile/
23
- $ appraiser
27
+ $ gem appraiser
24
28
 
25
29
  or, displays other dependencies with `-g GROUP`.
26
30
 
27
- $ appraiser -g development
31
+ $ gem appraiser -g development
28
32
 
29
33
 
30
34
  Contributing
@@ -9,18 +9,32 @@ Gem::Specification.new do |s|
9
9
  s.authors = ["Junya Ogura"]
10
10
  s.email = ["junyaogura@gmail.com"]
11
11
  s.homepage = "https://github.com/juno/appraiser"
12
- s.summary = %q{`appraiser` is a simple command line utility for Gemfile.}
13
- s.description = %q{`appraiser` is a command line utility which displays gem information in `./Gemfile`.}
12
+ s.licenses = ["MIT"]
13
+ s.summary = %q{`appraiser` is a simple rubygems subcommand for Gemfile.}
14
+ s.description = %q{`appraiser` is a rubygems subcommand which displays gem information in `./Gemfile`.}
14
15
 
15
16
  s.files = `git ls-files`.split("\n")
16
17
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
19
  s.require_paths = ["lib"]
19
20
 
21
+ s.post_install_message = %q{
22
+ appraiser installed as a rubygems subcommand.
23
+
24
+ (basic)
25
+ $ gem appraiser
26
+
27
+ (shorthand)
28
+ $ gem a
29
+
30
+ ("group" option)
31
+ $ gem a -g test
32
+
33
+ }
34
+
20
35
  s.add_dependency('bundler', ['~> 1.0'])
21
36
  s.add_dependency('colored', ['~> 1.2'])
22
37
  s.add_dependency('json')
23
- s.add_dependency('slop', ['~> 1.5'])
24
38
 
25
39
  s.add_development_dependency('rspec', ['~> 2.3'])
26
40
  end
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module Appraiser
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
6
6
 
7
7
 
@@ -1,25 +1,32 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
+ require 'rubygems/command'
4
+ require 'rubygems/dependency'
3
5
  require 'bundler'
4
6
  require 'colored'
5
7
  require 'json'
6
8
  require 'open-uri'
7
- require 'slop'
8
9
 
9
10
  require 'appraiser/version'
10
11
 
11
- module Appraiser
12
- extend self
13
-
12
+ class Gem::Commands::AppraiserCommand < Gem::Command
14
13
  RUBY_GEMS_URL = 'http://rubygems.org/api/v1/gems/%s.json'
15
14
  LINE = '-' * 60
16
15
 
17
- def execute(*args)
18
- opts = Slop.parse do
19
- on :g, :group, 'Group', true
16
+ def initialize
17
+ super 'appraiser', 'Display gem information in ./Gemfile'
18
+
19
+ add_option('-g', '--group=GROUP', 'Group') do |group, options|
20
+ options[:group] = group
20
21
  end
22
+ end
21
23
 
22
- group = opts.group? ? opts[:group].to_sym : :default
24
+ def usage # :nodoc:
25
+ "#{program_name} [-g group]"
26
+ end
27
+
28
+ def execute
29
+ group = (options[:group] || :default).to_sym
23
30
 
24
31
  dependencies_for(group).each do |dependency|
25
32
  json = load_json(dependency.name)
@@ -75,5 +82,4 @@ module Appraiser
75
82
  rescue
76
83
  number.to_s
77
84
  end
78
-
79
85
  end
@@ -0,0 +1,4 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'rubygems/command_manager'
3
+
4
+ Gem::CommandManager.instance.register_command :appraiser
@@ -2,6 +2,6 @@
2
2
 
3
3
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
4
4
 
5
- describe "Appraiser" do
6
- it "fails"
5
+ describe "Gem::Commands::AppraiserCommand" do
6
+ it "um..."
7
7
  end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
4
4
  $LOAD_PATH.unshift(File.dirname(__FILE__))
5
5
 
6
6
  require 'rspec'
7
- require 'appraiser'
7
+ require 'rubygems/commands/appraiser_command'
8
8
 
9
9
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
10
10
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: appraiser
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.4
5
+ version: 0.1.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Junya Ogura
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-23 00:00:00 +09:00
13
+ date: 2011-04-25 00:00:00 +09:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -46,33 +46,22 @@ dependencies:
46
46
  version: "0"
47
47
  type: :runtime
48
48
  version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
50
- name: slop
51
- prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
53
- none: false
54
- requirements:
55
- - - ~>
56
- - !ruby/object:Gem::Version
57
- version: "1.5"
58
- type: :runtime
59
- version_requirements: *id004
60
49
  - !ruby/object:Gem::Dependency
61
50
  name: rspec
62
51
  prerelease: false
63
- requirement: &id005 !ruby/object:Gem::Requirement
52
+ requirement: &id004 !ruby/object:Gem::Requirement
64
53
  none: false
65
54
  requirements:
66
55
  - - ~>
67
56
  - !ruby/object:Gem::Version
68
57
  version: "2.3"
69
58
  type: :development
70
- version_requirements: *id005
71
- description: `appraiser` is a command line utility which displays gem information in `./Gemfile`.
59
+ version_requirements: *id004
60
+ description: `appraiser` is a rubygems subcommand which displays gem information in `./Gemfile`.
72
61
  email:
73
62
  - junyaogura@gmail.com
74
- executables:
75
- - appraiser
63
+ executables: []
64
+
76
65
  extensions: []
77
66
 
78
67
  extra_rdoc_files: []
@@ -80,21 +69,23 @@ extra_rdoc_files: []
80
69
  files:
81
70
  - .gitignore
82
71
  - .rspec
72
+ - CHANGELOG
83
73
  - Gemfile
84
74
  - LICENSE.txt
85
75
  - README.md
86
76
  - Rakefile
87
77
  - appraiser.gemspec
88
- - bin/appraiser
89
- - lib/appraiser.rb
90
78
  - lib/appraiser/version.rb
79
+ - lib/rubygems/commands/appraiser_command.rb
80
+ - lib/rubygems_plugin.rb
91
81
  - spec/appraiser_spec.rb
92
82
  - spec/spec_helper.rb
93
83
  has_rdoc: true
94
84
  homepage: https://github.com/juno/appraiser
95
- licenses: []
96
-
97
- post_install_message:
85
+ licenses:
86
+ - MIT
87
+ post_install_message: "\n\
88
+ appraiser installed as a rubygems subcommand.\n\n (basic)\n $ gem appraiser\n\n (shorthand)\n $ gem a\n\n (\"group\" option)\n $ gem a -g test\n\n"
98
89
  rdoc_options: []
99
90
 
100
91
  require_paths:
@@ -117,7 +108,7 @@ rubyforge_project:
117
108
  rubygems_version: 1.6.2
118
109
  signing_key:
119
110
  specification_version: 3
120
- summary: `appraiser` is a simple command line utility for Gemfile.
111
+ summary: `appraiser` is a simple rubygems subcommand for Gemfile.
121
112
  test_files:
122
113
  - spec/appraiser_spec.rb
123
114
  - spec/spec_helper.rb
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # = appraiser(1)
4
- #
5
- # == USAGE
6
- # appraiser # with ./Gemfile
7
- #
8
- # == INSTALL
9
- # gem install appraiser
10
-
11
- $:.unshift(File.expand_path('../../lib', __FILE__)) if $0 == __FILE__
12
- require 'appraiser'
13
- Appraiser.execute(*ARGV)