nogizaka_blog 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea0a9f704e2faf48c660bebcaefbfb7793b630da
4
- data.tar.gz: 6a183503c5aa54db0e3c2bf20852de568b58d138
3
+ metadata.gz: 1af6852e062cb941c81edf13581fb91b95f41d92
4
+ data.tar.gz: f9ada162d0c388a372c9a1f30397b84c609d5084
5
5
  SHA512:
6
- metadata.gz: a90f802fd94b5b9c0ee90d1da098ffbdb788d38627c46d811e282feafc6eb3da32be438cf1cfb54003d006f14d4d4fbf296b911b445a1ffd691a7a22e4b3d078
7
- data.tar.gz: aba40c4546624000b4f698ee6515412e54899d957d3c88ca832d2a3518a6d266cbcac29fd0923e0b4cd88add7326d2ffac6fe89fe14f77a08ff3bd9b4f2791b3
6
+ metadata.gz: 1e8e9b5cde6219217d82068ff68f6e718cf9b18206d3e36bad3df85db6ce5455f89c3b907db9817f4eb39989fa41b211dc4e93f9d269ebe7c4551ab708f5b686
7
+ data.tar.gz: 007e073d87e505c2263acf72036a566b31691a5757852b0ee51669f926fadd10d1627e2493e52cfd537875c699d45979d909aa4ca78e57657d8395b04a9aaa36
data/README.md CHANGED
@@ -18,7 +18,11 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- $ ruby nogizaka_blog -m 201405
21
+ $ nogizaka_blog yearmonth 201405
22
+
23
+ Generate JSON
24
+
25
+ $ nogizaka_blog yearmonth 201405 --json
22
26
 
23
27
  ## Contributing
24
28
 
@@ -1,27 +1,25 @@
1
- require 'optparse'
1
+ require 'thor'
2
2
 
3
3
  module NogizakaBlog
4
- OptionParser.new do |opt|
5
- opt.banner = "Usage: ruby nogizaka_blog.rb -m 201404"
6
-
7
- opt.on('-m [yearmonth]', "specify the month you want to get. ex. 201404") do |yearmonth|
8
- @yearmonth = yearmonth
9
- unless ARGV.include?("-j")
10
- nogizaka = NogizakaBlog::Amazing.new(@yearmonth)
4
+ class CLI < Thor
5
+ desc "yearmonth YEARMONTH", "show the number of comments and articles of Nogizaka46's blog"
6
+ option :json, :type => :boolean, :aliases => '-j'
7
+ def yearmonth(ym)
8
+ nogizaka = NogizakaBlog::Amazing.new(ym)
9
+ if options[:json]
10
+ nogizaka.__send__ :gen_json
11
+ else
11
12
  nogizaka.__send__ :run
12
13
  end
13
14
  end
15
+ map %w(-ym --yearmonth) => :yearmonth
14
16
 
15
- opt.on('-j', 'JSON format') do
16
- nogizaka = NogizakaBlog::Amazing.new(@yearmonth)
17
- nogizaka.__send__ :gen_json
18
- end
19
-
20
- opt.on_tail('-v', '--version', 'Show version') do
17
+ desc "version", "show NogizakaBlog version"
18
+ def version
21
19
  puts "NogizakaBlog #{NogizakaBlog::VERSION}"
22
- exit
23
20
  end
24
-
25
- opt.parse!(ARGV)
21
+ map %w(-v --version) => :version
26
22
  end
23
+
24
+ CLI.start(ARGV)
27
25
  end
@@ -1,3 +1,3 @@
1
1
  module NogizakaBlog
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["pekoett@gmail.com"]
11
11
  spec.summary = %q{Get the number of comments and articles per month from Nogizaka46's blog}
12
12
  spec.description = %q{Get the number of comments and articles per month from Nogizaka46's blog}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/hachy/nogizaka_blog"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.add_dependency 'thor'
21
22
  spec.add_dependency 'nokogiri'
22
23
  spec.add_development_dependency "bundler", "~> 1.6"
23
24
  spec.add_development_dependency "rake"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nogizaka_blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - hachy
@@ -10,6 +10,20 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2014-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: nokogiri
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -73,7 +87,7 @@ files:
73
87
  - lib/nogizaka_blog/member.rb
74
88
  - lib/nogizaka_blog/version.rb
75
89
  - nogizaka_blog.gemspec
76
- homepage: ''
90
+ homepage: https://github.com/hachy/nogizaka_blog
77
91
  licenses:
78
92
  - MIT
79
93
  metadata: {}