knitter 0.1.2 → 0.2.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: e82753716316626ad237b157accc0f29383a5521
4
- data.tar.gz: 6c160275f5a6b7143d59d683ab7ed2101e5968ad
3
+ metadata.gz: 0457bc4096cb434b2226c51bcc5008aa3eed65e4
4
+ data.tar.gz: db000c1c179ccda9fb1770becc127638618d1d9d
5
5
  SHA512:
6
- metadata.gz: 6d4acd212cf1a56e606cc743b522f23ca087fc98c245378c3157d8769028c554d0f157a978f5d845cf59d610aefebeede970aebef07e76b56441c36ecf69b84d
7
- data.tar.gz: e26438c35d2ed5b7636b98bbae765fddfce95609f1548edd59f497ab347a4289e214a1d7502d4db1fdeb54a11dfd10b07bc952c07800fb2177b278a917e419c0
6
+ metadata.gz: 840790dc8c6d747cbbdd383eb674848d4f029385bfeb00e70932f21912737f622a5fa59d6cf79878d2ac62eb15e65e5446c69db6fe62ac1b1eea6ac39b8d6acb
7
+ data.tar.gz: 03a277324c8c15e8b39a6bda665ec7f5ebb2ce33aefee611ee6857b864d7d232d63874b796da3631b6046c4a63d769a39e899f879b6c95abecf5b28dc0590ec9
data/README.md CHANGED
@@ -35,7 +35,7 @@ package = Knitter::Package.new('left-pad', yarn: yarn)
35
35
 
36
36
  package.installed? # false
37
37
 
38
- package.install
38
+ package.add
39
39
 
40
40
  package.installed? # true
41
41
  ```
@@ -1,3 +1,3 @@
1
1
  module Knitter
2
- VERSION = '0.1.2'
2
+ VERSION = '0.2.0'
3
3
  end
data/lib/knitter/yarn.rb CHANGED
@@ -4,6 +4,9 @@ require 'forwardable'
4
4
  module Knitter
5
5
  class Yarn
6
6
 
7
+ class CommandExecutionError < RuntimeError
8
+ end
9
+
7
10
  PACKAGE_AREAS = {
8
11
  dev: 'devDependencies',
9
12
  peer: 'peerDependencies',
@@ -61,7 +64,7 @@ module Knitter
61
64
  end
62
65
 
63
66
  def valid?
64
- package_file_contents
67
+ package_file.exist? && package_file_contents
65
68
  end
66
69
 
67
70
  protected
@@ -80,6 +83,9 @@ module Knitter
80
83
  cwd: @directory.to_s
81
84
  )
82
85
  @sh.run_command
86
+ unless 0 == @sh.exitstatus
87
+ raise CommandExecutionError.new(@sh.stderr)
88
+ end
83
89
  end
84
90
  end
85
91
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Stitt
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-12 00:00:00.000000000 Z
11
+ date: 2017-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  requirements: []
144
144
  rubyforge_project:
145
- rubygems_version: 2.6.8
145
+ rubygems_version: 2.5.1
146
146
  signing_key:
147
147
  specification_version: 4
148
148
  summary: Wraps the Javascript "yarn" package manager command