parse_gemspec 0.2.0 → 0.3.0

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: 239de115ade90d071db6f688b54ed30f5aa2edab
4
- data.tar.gz: 14a5d1c970680366597294f2a1875e8bc69c8a71
3
+ metadata.gz: 5d60d7ca151df62edb7a8316a387e12325bfa4d0
4
+ data.tar.gz: 01cf8854ba930e11684e2cc1c381ab2889787eba
5
5
  SHA512:
6
- metadata.gz: bddab34d1bd9a264f7dda883ada9aa2ebef1605e4623982d8813161441158b0eb9110c83a4703813d7f6986fc9b1a0fe760cf258f6a8fedef48841070c0291c0
7
- data.tar.gz: e58be5feafd446b912d7df43c0c8dff1067c7d76952c1c34f5bb9e429d5d3226f700c6c88e6bad28b7d66f73cd16de6e119d1764255d68043a5c8c18a236d984
6
+ metadata.gz: 57bd04a3dcbfedcc5a47a2a4fe566efe74a6bca0e2e90d871d9043d4b68099330bd51cd4a46fa26a15e4f50455d6bb87af4bd8928b0e97be242093e208888fb8
7
+ data.tar.gz: ca2faf73ba5fd3ad7237f5686631cce9e475b754bcf319a2dcf751619b26a56f4775d50fe5e21463e58bc234b9c91a567dc2c2bbdce0fe075f06c677beb057e4
@@ -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.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/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
  /tmp/
10
10
  /example/.bundle/
11
11
  /example/vendor/
12
+ /node_modules/
data/Gemfile CHANGED
@@ -3,6 +3,7 @@ source 'https://rubygems.org'
3
3
  group :development do
4
4
  gem 'rubocop', group: :test
5
5
  gem 'byebug', group: :test
6
+ gem 'parse_gemspec-cli'
6
7
  end
7
8
  # Specify your gem's dependencies in parse_gemspec.gemspec
8
9
  gemspec
data/bin/setup CHANGED
@@ -11,3 +11,9 @@ unless ENV['CI']
11
11
  $stderr.puts err
12
12
  exit status.exitstatus if !status.exitstatus.nil? && status.exitstatus != 0
13
13
  end
14
+ unless ENV['CI']
15
+ out, err, status = Open3.capture3(*%w(npm install))
16
+ $stdout.puts out
17
+ $stderr.puts err
18
+ exit status.exitstatus if !status.exitstatus.nil? && status.exitstatus != 0
19
+ end
data/changelog.md CHANGED
@@ -1,3 +1,15 @@
1
+ <a name="0.3.0"></a>
2
+ # [0.3.0](https://github.com/packsaddle/ruby-parse_gemspec/compare/v0.2.0...v0.3.0) (2015-09-24)
3
+
4
+ * Add error.
5
+
6
+
7
+ ### Features
8
+
9
+ * **specification:** argument is file ([2a8e375](https://github.com/packsaddle/ruby-parse_gemspec/commit/2a8e375))
10
+
11
+
12
+
1
13
  <a name"0.2.0"></a>
2
14
  ### 0.2.0 (2015-09-23)
3
15
 
@@ -0,0 +1,4 @@
1
+ module ParseGemspec
2
+ class ParseGemspecError < StandardError; end
3
+ class GemspecFileNotFoundError < ParseGemspecError; end
4
+ end
@@ -3,8 +3,10 @@ module ParseGemspec
3
3
  extend Forwardable
4
4
  def_delegators :@spec, :name, :version, :homepage
5
5
 
6
- def self.load(*args)
7
- spec = Gem::Specification.load(*args)
6
+ def self.load(file)
7
+ fail GemspecFileNotFoundError, "file: #{file}" unless File.file?(file)
8
+ spec = Gem::Specification.load(file)
9
+ fail ParseGemspecError, "file: #{file}" unless spec
8
10
  new(spec)
9
11
  end
10
12
 
@@ -1,3 +1,3 @@
1
1
  module ParseGemspec
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
data/lib/parse_gemspec.rb CHANGED
@@ -2,6 +2,7 @@ require 'rubygems'
2
2
  require 'forwardable'
3
3
 
4
4
  require 'parse_gemspec/constants'
5
+ require 'parse_gemspec/error'
5
6
  require 'parse_gemspec/specification'
6
7
  require 'parse_gemspec/version'
7
8
 
data/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "devDependencies": {
3
+ "conventional-changelog": "0.4.3",
4
+ "npm-check-updates": "^2.2.3",
5
+ "urijs": "^1.16.1"
6
+ },
7
+ "scripts": {
8
+ "changelog": "conventional-changelog -i changelog.md --overwrite --preset angular --context .conventional-changelog.context.js",
9
+ "ncu": "ncu -u"
10
+ }
11
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parse_gemspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
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-23 00:00:00.000000000 Z
11
+ date: 2015-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -59,6 +59,7 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - ".conventional-changelog.context.js"
62
63
  - ".gitignore"
63
64
  - ".gitmodules"
64
65
  - ".rubocop.yml"
@@ -76,8 +77,10 @@ files:
76
77
  - example/setup.rb
77
78
  - lib/parse_gemspec.rb
78
79
  - lib/parse_gemspec/constants.rb
80
+ - lib/parse_gemspec/error.rb
79
81
  - lib/parse_gemspec/specification.rb
80
82
  - lib/parse_gemspec/version.rb
83
+ - package.json
81
84
  - parse_gemspec.gemspec
82
85
  homepage: https://github.com/packsaddle/ruby-parse_gemspec
83
86
  licenses: