parser-cli_wrapper 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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3027d60e9351b3c7887e4e70e3d9bc22096b6f21
4
+ data.tar.gz: 6d72ff655771fd8d7ae5ec0eac8de6baa3f23218
5
+ SHA512:
6
+ metadata.gz: 2dbd23c1977f122caa85331836773a1ce1a8dee41357ca1ac8e0d4fac4df89a1359c177bb87cca1b6ea3c5be3be51f5055b7c0b6f820065d0495aaec5929532f
7
+ data.tar.gz: 8c22daf0401200ef8e22d6172a5633aaaadc6d0cfe180adde1f43a3fb048e0766f58a4e1352cace9eeecceac2da5e41b1d478f6918a42e321ae90398267bf82f
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/.rubocop.yml ADDED
@@ -0,0 +1,14 @@
1
+ inherit_from: rubocop-todo.yml
2
+ AllCops:
3
+ Include:
4
+ - '**/Rakefile'
5
+ - Gemfile
6
+ - parser-cli_wrapper.gemspec
7
+ - bin/**
8
+ - lib/**/*.rake
9
+ Exclude:
10
+ - pkg/**
11
+ - repos/**
12
+ - vendor/**
13
+ StringLiterals:
14
+ EnforcedStyle: single_quotes
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in parser-cli_wrapper.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 sanemat
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # Parser::CliWrapper
2
+
3
+ This replaces '-' with STDIN like unix option, the example below:
4
+
5
+ ```
6
+ $ cat Gemfile | ruby-parse-wrapped -
7
+ (begin
8
+ (send nil :source
9
+ (str "https://rubygems.org"))
10
+ (send nil :gemspec))
11
+ ```
12
+
13
+ This is pareparation:
14
+
15
+ ```
16
+ $ cat Gemfile
17
+ source 'https://rubygems.org';
18
+
19
+ gemspec
20
+
21
+ $ ruby-parse Gemfile
22
+ (begin
23
+ (send nil :source
24
+ (str "https://rubygems.org"))
25
+ (send nil :gemspec))
26
+ ```
27
+
28
+ ## Installation
29
+
30
+ Add this line to your application's Gemfile:
31
+
32
+ ```ruby
33
+ gem 'parser-cli_wrapper'
34
+ ```
35
+
36
+ And then execute:
37
+
38
+ $ bundle
39
+
40
+ Or install it yourself as:
41
+
42
+ $ gem install parser-cli_wrapper
43
+
44
+ ## Usage
45
+
46
+ TODO: Write usage instructions here
47
+
48
+ ## Contributing
49
+
50
+ 1. Fork it ( https://github.com/sanemat/parser-cli_wrapper/fork )
51
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
52
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
53
+ 4. Push to the branch (`git push origin my-new-feature`)
54
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env ruby
2
+ require 'tempfile'
3
+ require 'parser/runner/ruby_parse'
4
+
5
+ buff = []
6
+
7
+ flag_stdin = ARGV.delete('-')
8
+
9
+ if flag_stdin
10
+ while line = STDIN.gets
11
+ buff << line
12
+ end
13
+ end
14
+
15
+ if flag_stdin
16
+ Tempfile.open(['temp', '.rb']) { |file|
17
+ file.print(buff.join)
18
+ file.rewind
19
+ Parser::Runner::RubyParse.go(ARGV + [file.path])
20
+ }
21
+ else
22
+ Parser::Runner::RubyParse.go(ARGV)
23
+ end
@@ -0,0 +1,5 @@
1
+ module Parser
2
+ module CliWrapper
3
+ VERSION = '0.1.0'
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ require 'parser/cli_wrapper/version'
2
+
3
+ module Parser
4
+ module CliWrapper
5
+ # Your code goes here...
6
+ end
7
+ end
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'parser/cli_wrapper/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'parser-cli_wrapper'
8
+ spec.version = Parser::CliWrapper::VERSION
9
+ spec.authors = ['sanemat']
10
+ spec.email = ['o.gata.ken@gmail.com']
11
+ spec.summary = 'Enable stdin with ruby-parse'
12
+ spec.description = 'Replace "-" with STDIN like unix option.'
13
+ spec.homepage = 'https://github.com/sanemat/parser-cli_wrapper'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'parser', '>= 2.2.0.pre.8', '< 3.0'
22
+ spec.add_development_dependency 'bundler', '~> 1.7'
23
+ spec.add_development_dependency 'rake', '~> 10.0'
24
+ end
data/rubocop-todo.yml ADDED
@@ -0,0 +1,9 @@
1
+ # This configuration was generated by `rubocop --auto-gen-config`.
2
+ # The point is for the user to remove these configuration records
3
+ # one by one as the offences are removed from the code base.
4
+
5
+ Blocks:
6
+ Enabled: false
7
+
8
+ LineLength:
9
+ Enabled: false
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: parser-cli_wrapper
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - sanemat
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-11-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: parser
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.2.0.pre.8
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 2.2.0.pre.8
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: bundler
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.7'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.7'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '10.0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '10.0'
61
+ description: Replace "-" with STDIN like unix option.
62
+ email:
63
+ - o.gata.ken@gmail.com
64
+ executables:
65
+ - ruby-parse-wrapped
66
+ extensions: []
67
+ extra_rdoc_files: []
68
+ files:
69
+ - ".gitignore"
70
+ - ".rubocop.yml"
71
+ - Gemfile
72
+ - LICENSE.txt
73
+ - README.md
74
+ - Rakefile
75
+ - bin/ruby-parse-wrapped
76
+ - lib/parser/cli_wrapper.rb
77
+ - lib/parser/cli_wrapper/version.rb
78
+ - parser-cli_wrapper.gemspec
79
+ - rubocop-todo.yml
80
+ homepage: https://github.com/sanemat/parser-cli_wrapper
81
+ licenses:
82
+ - MIT
83
+ metadata: {}
84
+ post_install_message:
85
+ rdoc_options: []
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ required_rubygems_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ requirements: []
99
+ rubyforge_project:
100
+ rubygems_version: 2.2.2
101
+ signing_key:
102
+ specification_version: 4
103
+ summary: Enable stdin with ruby-parse
104
+ test_files: []