gem-stats 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +19 -0
- data/README.md +16 -0
- data/lib/rubygems/commands/stats_command.rb +32 -0
- data/lib/rubygems_plugin.rb +3 -0
- metadata +67 -0
data/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2009 Danny Tatom
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# gem-stats
|
2
|
+
|
3
|
+
View gemcutter stastics for any given gem.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
> gem stats goldfish
|
8
|
+
|
9
|
+
goldfish by Robert Gleeson
|
10
|
+
--------------------------
|
11
|
+
Downloads: 8
|
12
|
+
Current version: 0.1.1
|
13
|
+
|
14
|
+
## Copyright
|
15
|
+
|
16
|
+
Copyright (c) 2009 Danny Tatom. See LICENSE for details.
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
|
3
|
+
class Gem::Commands::StatsCommand < Gem::Command
|
4
|
+
format :json
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
super 'stats', 'View gemcutter statistics for any given gem'
|
8
|
+
end
|
9
|
+
|
10
|
+
def arguments
|
11
|
+
'[gem name]'
|
12
|
+
end
|
13
|
+
|
14
|
+
def usage
|
15
|
+
"#{program_name} [gem-name]"
|
16
|
+
end
|
17
|
+
|
18
|
+
def get_stats gem
|
19
|
+
HTTParty.get "http://gemcutter.org/gems/#{gem}.json"
|
20
|
+
end
|
21
|
+
|
22
|
+
def execute
|
23
|
+
gem = get_one_optional_argument
|
24
|
+
stats = get_stats gem
|
25
|
+
gem_name = "#{stats['name']} by #{stats['authors']}"
|
26
|
+
|
27
|
+
puts gem_name
|
28
|
+
puts '-' * gem_name.size
|
29
|
+
puts "Downloads: #{stats['downloads']}"
|
30
|
+
puts "Current version: #{stats['version']}"
|
31
|
+
end
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gem-stats
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Danny Tatom
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-11-05 00:00:00 -06:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: httparty
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.4.5
|
24
|
+
version:
|
25
|
+
description: View gemcutter statistics for any given gem.
|
26
|
+
email: dannytatom@gmail.com
|
27
|
+
executables: []
|
28
|
+
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files: []
|
32
|
+
|
33
|
+
files:
|
34
|
+
- README.md
|
35
|
+
- LICENSE
|
36
|
+
- lib/rubygems/commands/stats_command.rb
|
37
|
+
- lib/rubygems_plugin.rb
|
38
|
+
has_rdoc: false
|
39
|
+
homepage: http://github.com/dannytatom/gem-stats
|
40
|
+
licenses: []
|
41
|
+
|
42
|
+
post_install_message:
|
43
|
+
rdoc_options: []
|
44
|
+
|
45
|
+
require_paths:
|
46
|
+
- lib
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: "0"
|
52
|
+
version:
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: "0"
|
58
|
+
version:
|
59
|
+
requirements: []
|
60
|
+
|
61
|
+
rubyforge_project:
|
62
|
+
rubygems_version: 1.3.5
|
63
|
+
signing_key:
|
64
|
+
specification_version: 3
|
65
|
+
summary: View gemcutter statistics for any given gem.
|
66
|
+
test_files: []
|
67
|
+
|