parse_gemspec-cli 0.4.0 → 0.4.1
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 +4 -4
- data/.conventional-changelog.context.js +17 -0
- data/README.md +59 -7
- data/changelog.md +7 -0
- data/example/Gemfile.lock +5 -1
- data/example/example.sh +3 -0
- data/lib/parse_gemspec/cli/cli.rb +1 -2
- data/lib/parse_gemspec/cli/version.rb +1 -1
- data/package.json +3 -3
- data/parse_gemspec-cli.gemspec +2 -2
- metadata +6 -5
- data/bin/conventional-changelog +0 -42
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df9c57db656a10ed8dc4872186e9de5af9650a4c
|
4
|
+
data.tar.gz: bb0836f3b31c543823f39105e68feb6ad99c3c1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f440e12fe8adc056a816e39dab153cc2b9f7ba638b5110a148b15f18fde3309581cb3b5e9c27991d464699f4ce1a09d60b2c201a3855e0cdf637363ee8075f36
|
7
|
+
data.tar.gz: cce36732a517401f91917f12ed429324ae327c7711e1d9f3fb8ed0ce090b25fa17bc8acbe42b1dc0c5316f7eeda665ed884a4737ed188c1d750bfe23a98ed46e
|
@@ -0,0 +1,17 @@
|
|
1
|
+
'use strict';
|
2
|
+
var execSync = require('child_process').execSync;
|
3
|
+
var URI = require('urijs');
|
4
|
+
|
5
|
+
var gemspec = JSON.parse(execSync('bundle exec parse-gemspec-cli parse_gemspec-cli.gemspec'));
|
6
|
+
var homepageUrl = gemspec.homepage;
|
7
|
+
var url = new URI(homepageUrl);
|
8
|
+
var host = url.protocol() + '://' + url.authority();
|
9
|
+
var owner = url.pathname().split('/')[1];
|
10
|
+
var repository = url.pathname().split('/')[2];
|
11
|
+
|
12
|
+
module.exports = {
|
13
|
+
version: gemspec.version,
|
14
|
+
host: host,
|
15
|
+
owner: owner,
|
16
|
+
repository: repository
|
17
|
+
};
|
data/README.md
CHANGED
@@ -1,8 +1,56 @@
|
|
1
1
|
# ParseGemspec::Cli
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem version][gem-image]][gem-url] [![Travis-CI Status][travis-image]][travis-url]
|
4
|
+
|
5
|
+
> CLI for parsing *.gemspec file. Convert to JSON format.
|
6
|
+
|
7
|
+
See [parse_gemspec](https://rubygems.org/gems/parse_gemspec) ([repo](https://github.com/packsaddle/ruby-parse_gemspec)) for the programmatic API.
|
8
|
+
|
9
|
+
|
10
|
+
## Usage
|
11
|
+
|
12
|
+
```bash
|
13
|
+
$ parse-gemspec-cli
|
14
|
+
Commands:
|
15
|
+
parse-gemspec-cli help [COMMAND] # Describe available commands or one specific command
|
16
|
+
parse-gemspec-cli [parse] GEMSPEC_PATH # Parse *.gemspec
|
17
|
+
parse-gemspec-cli version # Show the ParseGemspec::Cli version
|
18
|
+
```
|
19
|
+
|
20
|
+
|
21
|
+
## Example
|
22
|
+
|
23
|
+
### Pretty print
|
24
|
+
|
25
|
+
```bash
|
26
|
+
$ parse-gemspec-cli checkstyle_filter-git.gemspec | jq .
|
27
|
+
{
|
28
|
+
"name": "checkstyle_filter-git",
|
29
|
+
"version": "1.0.3.pre.beta",
|
30
|
+
"homepage": "https://github.com/packsaddle/ruby-checkstyle_filter-git"
|
31
|
+
}
|
32
|
+
```
|
33
|
+
|
34
|
+
|
35
|
+
### Use from another language
|
36
|
+
|
37
|
+
```js
|
38
|
+
// javascript
|
39
|
+
'use strict';
|
40
|
+
var execSync = require('child_process').execSync;
|
41
|
+
var gemspec = JSON.parse(execSync('bundle exec parse-gemspec-cli parse_gemspec-cli.gemspec'));
|
42
|
+
|
43
|
+
module.exports = {
|
44
|
+
version: gemspec.version
|
45
|
+
};
|
46
|
+
```
|
47
|
+
|
48
|
+
Actual example [.conventional-changelog.context.js](./.conventional-changelog.context.js).
|
49
|
+
|
50
|
+
## Changelog
|
51
|
+
|
52
|
+
[changelog.md](./changelog.md).
|
4
53
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
54
|
|
7
55
|
## Installation
|
8
56
|
|
@@ -20,22 +68,26 @@ Or install it yourself as:
|
|
20
68
|
|
21
69
|
$ gem install parse_gemspec-cli
|
22
70
|
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
TODO: Write usage instructions here
|
26
71
|
|
27
72
|
## Development
|
28
73
|
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake
|
74
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
75
|
|
31
76
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
77
|
|
78
|
+
|
33
79
|
## Contributing
|
34
80
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
81
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/packsaddle/ruby-parse_gemspec-cli. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
36
82
|
|
37
83
|
|
38
84
|
## License
|
39
85
|
|
86
|
+
© [sanemat](http://sane.jp)
|
87
|
+
|
40
88
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
89
|
|
90
|
+
[travis-url]: https://travis-ci.org/packsaddle/ruby-parse_gemspec-cli
|
91
|
+
[travis-image]: https://img.shields.io/travis/packsaddle/ruby-parse_gemspec-cli/master.svg?style=flat-square&label=build%20%28linux%29
|
92
|
+
[gem-url]: https://rubygems.org/gems/parse_gemspec-cli
|
93
|
+
[gem-image]: http://img.shields.io/gem/v/parse_gemspec-cli.svg?style=flat-square
|
data/changelog.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
<a name="0.4.1"></a>
|
2
|
+
## [0.4.1](https://github.com/packsaddle/ruby-parse_gemspec-cli/compare/v0.4.0...v0.4.1) (2015-09-24)
|
3
|
+
|
4
|
+
* CLI improvement
|
5
|
+
* Update documents
|
6
|
+
|
7
|
+
|
1
8
|
<a name="0.4.0"></a>
|
2
9
|
# [0.4.0](https://github.com/packsaddle/ruby-parse_gemspec-cli/compare/v0.3.0...v0.4.0) (2015-09-23)
|
3
10
|
|
data/example/Gemfile.lock
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
parse_gemspec-cli (0.
|
4
|
+
parse_gemspec-cli (0.4.0)
|
5
|
+
multi_json
|
6
|
+
parse_gemspec
|
5
7
|
thor
|
6
8
|
|
7
9
|
GEM
|
8
10
|
remote: https://rubygems.org/
|
9
11
|
specs:
|
12
|
+
multi_json (1.11.2)
|
13
|
+
parse_gemspec (0.4.0)
|
10
14
|
thor (0.19.1)
|
11
15
|
|
12
16
|
PLATFORMS
|
data/example/example.sh
ADDED
@@ -32,7 +32,6 @@ module ParseGemspec
|
|
32
32
|
suggest_messages(options)
|
33
33
|
raise e
|
34
34
|
end
|
35
|
-
default_command :parse
|
36
35
|
|
37
36
|
no_commands do
|
38
37
|
def logger
|
@@ -57,7 +56,7 @@ module ParseGemspec
|
|
57
56
|
|
58
57
|
# http://stackoverflow.com/a/23955971/104080
|
59
58
|
def method_missing(method, *args)
|
60
|
-
self.class.start([
|
59
|
+
self.class.start([:parse, method.to_s] + args)
|
61
60
|
end
|
62
61
|
end
|
63
62
|
end
|
data/package.json
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"devDependencies": {
|
3
|
-
"add-stream": "^1.0.0",
|
4
3
|
"conventional-changelog": "0.4.3",
|
5
|
-
"
|
4
|
+
"npm-check-updates": "^2.2.3",
|
6
5
|
"urijs": "^1.16.1"
|
7
6
|
},
|
8
7
|
"scripts": {
|
9
|
-
"changelog": "
|
8
|
+
"changelog": "conventional-changelog -i changelog.md --overwrite --preset angular --context .conventional-changelog.context.js",
|
9
|
+
"ncu": "ncu -u"
|
10
10
|
}
|
11
11
|
}
|
data/parse_gemspec-cli.gemspec
CHANGED
@@ -11,9 +11,9 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.email = ['o.gata.ken@gmail.com']
|
12
12
|
|
13
13
|
spec.summary =
|
14
|
-
'CLI for parsing *.gemspec file'
|
14
|
+
'CLI for parsing *.gemspec file. Convert to JSON format.'
|
15
15
|
spec.description =
|
16
|
-
'CLI for parsing *.gemspec file'
|
16
|
+
'CLI for parsing *.gemspec file. Convert to JSON format.'
|
17
17
|
spec.homepage = ParseGemspec::Cli::HOMEPAGE
|
18
18
|
spec.license = 'MIT'
|
19
19
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parse_gemspec-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sanemat
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -94,7 +94,7 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
-
description: CLI for parsing *.gemspec file
|
97
|
+
description: CLI for parsing *.gemspec file. Convert to JSON format.
|
98
98
|
email:
|
99
99
|
- o.gata.ken@gmail.com
|
100
100
|
executables:
|
@@ -102,6 +102,7 @@ executables:
|
|
102
102
|
extensions: []
|
103
103
|
extra_rdoc_files: []
|
104
104
|
files:
|
105
|
+
- ".conventional-changelog.context.js"
|
105
106
|
- ".gitignore"
|
106
107
|
- ".rubocop.yml"
|
107
108
|
- ".travis.yml"
|
@@ -111,11 +112,11 @@ files:
|
|
111
112
|
- README.md
|
112
113
|
- Rakefile
|
113
114
|
- bin/console
|
114
|
-
- bin/conventional-changelog
|
115
115
|
- bin/setup
|
116
116
|
- changelog.md
|
117
117
|
- example/Gemfile
|
118
118
|
- example/Gemfile.lock
|
119
|
+
- example/example.sh
|
119
120
|
- example/setup.rb
|
120
121
|
- exe/parse-gemspec-cli
|
121
122
|
- lib/parse_gemspec/cli.rb
|
@@ -147,5 +148,5 @@ rubyforge_project:
|
|
147
148
|
rubygems_version: 2.4.5
|
148
149
|
signing_key:
|
149
150
|
specification_version: 4
|
150
|
-
summary: CLI for parsing *.gemspec file
|
151
|
+
summary: CLI for parsing *.gemspec file. Convert to JSON format.
|
151
152
|
test_files: []
|
data/bin/conventional-changelog
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
#!/usr/bin/env node
|
2
|
-
|
3
|
-
var fs = require('fs');
|
4
|
-
var execSync = require('child_process').execSync;
|
5
|
-
var conventionalChangelog = require('conventional-changelog');
|
6
|
-
var tempfile = require('tempfile');
|
7
|
-
var addStream = require('add-stream');
|
8
|
-
var URI = require('urijs');
|
9
|
-
|
10
|
-
var gemspec = JSON.parse(execSync('bundle exec exe/parse-gemspec-cli parse_gemspec-cli.gemspec'));
|
11
|
-
|
12
|
-
var options = { preset: 'angular' };
|
13
|
-
var homepageUrl = gemspec.homepage;
|
14
|
-
var url = new URI(homepageUrl);
|
15
|
-
var host = url.protocol() + '://' + url.authority();
|
16
|
-
var owner = url.pathname().split('/')[1];
|
17
|
-
var repository = url.pathname().split('/')[2];
|
18
|
-
|
19
|
-
var templateContext = {
|
20
|
-
version: gemspec.version,
|
21
|
-
host: host,
|
22
|
-
owner: owner,
|
23
|
-
repository: repository
|
24
|
-
};
|
25
|
-
var infile = 'changelog.md';
|
26
|
-
var outfile = 'changelog.md';
|
27
|
-
var changelogStream = conventionalChangelog(options, templateContext)
|
28
|
-
.on('error', function(err) {
|
29
|
-
console.error(err.toString());
|
30
|
-
process.exit(1);
|
31
|
-
});
|
32
|
-
|
33
|
-
var tmp = tempfile();
|
34
|
-
var readStream = fs.createReadStream(infile);
|
35
|
-
|
36
|
-
changelogStream
|
37
|
-
.pipe(addStream(readStream))
|
38
|
-
.pipe(fs.createWriteStream(tmp))
|
39
|
-
.on('finish', function() {
|
40
|
-
fs.createReadStream(tmp)
|
41
|
-
.pipe(fs.createWriteStream(outfile));
|
42
|
-
});
|