jr-cli 0.0.3 → 0.1.0

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -1
  3. data/bin/jr +8 -0
  4. data/lib/jr/cli/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 571f0ebed46056b1357383e6ad9161fe330057e7
4
- data.tar.gz: 17742313424d2d177a5a97058b8f54e10d693ae8
3
+ metadata.gz: dc2ffde2cd8c8ed240f2c6ac95280989f832c9d2
4
+ data.tar.gz: ce5baad0960ed09d2b9d40522bb8310bf6e9e2a2
5
5
  SHA512:
6
- metadata.gz: 8386745b224fb617bbde00c45b96e2c1dbb57afdb1cc4f74b0ccd6bb425440dbf8aff9790d22e05a92cb35edd9fd814dfccf09461c00f73263b967e531739129
7
- data.tar.gz: 8b38c081c77377d95a720bb3dd58c14a253a53c2fbc9b9ffe52cc87fcc73e7238f32cca9850c31a5ff966e424fc4877083f68cfb4d674753578884f8f72b8bf0
6
+ metadata.gz: 985ebad8fec41d956073bdd22858aa04d271ed22889a5b7dbf882bb995adcfb960783feac2bde3a607c796993dd06a15184b87b7f4d3ba1c411671f42e931ce5
7
+ data.tar.gz: 62b23da2e0d80609da765e17c03c12da04437f06cd26730eb7cff57e2ed1d386d6fdbd648cc293148f35344b9eeea4f6c1100ec439e408b05a9132fbc7bf9ffd
data/README.md CHANGED
@@ -24,11 +24,15 @@ Or install it yourself as:
24
24
  jr filter can be written in Ruby!
25
25
 
26
26
  ```
27
- $ jr <jr filter> [file...]
27
+ $ jr [options] <jr filter> [file...]
28
28
  ```
29
29
 
30
30
  You can also read JSON not from files but from STDIN.
31
31
 
32
+ ### options
33
+
34
+ * -r FILE: require the FILE before execution
35
+
32
36
  ## jr filter tutorial
33
37
 
34
38
  Let's process JSON of GitHub API!
data/bin/jr CHANGED
@@ -5,8 +5,16 @@ lib = File.expand_path('../../lib', __FILE__)
5
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
6
 
7
7
  require 'jr/cli/version'
8
+ require 'optparse'
8
9
  require 'yajl'
9
10
 
11
+ opt = OptionParser.new
12
+ opt.banner = "jr - Command-line JSON processor for Rubyists [Ver. #{Jr::Cli::VERSION}]\n\n" +
13
+ "Usage: jr [options] <jr filter> [file...]"
14
+ opt.version = Jr::Cli::VERSION
15
+ opt.on('-r FILE', 'require the FILE before execution') {|file| require file }
16
+ opt.parse! ARGV
17
+
10
18
  unless Kernel.respond_to? :itself
11
19
  module Kernel
12
20
  def itself
@@ -1,5 +1,5 @@
1
1
  module Jr
2
2
  module Cli
3
- VERSION = "0.0.3"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jr-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuya Takeyama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-05 00:00:00.000000000 Z
11
+ date: 2014-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yajl-ruby