jarbs 0.5.1 → 0.5.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5bccaf78f308809bfd3db697d8ce78253dd09397
4
- data.tar.gz: e5c01044236be1a93eace8106f9464d5ffc91fb5
3
+ metadata.gz: 9341d906bb5a7ed7e80b4216c73cd21ebf7b5ec2
4
+ data.tar.gz: f04b43e11edd1e748769cc6972fbf03e8c6aa99b
5
5
  SHA512:
6
- metadata.gz: 7dd415e13e4e86ca2d55133b162c7b404b97c3685ad4c215e3e7926945e194b8f6f973ab10db78c02213089b03a40160669c20420a008ff9456ceb7c08f093a5
7
- data.tar.gz: e83e3b3003ccaa8acf3fc1268a055100c482ee7e770700f0b3a8769f62de32d31e5c7e3a6f9dbc56e10a0bce400a5472be2deed34d1a79d76cde5bc02a600f5d
6
+ metadata.gz: 976383ac721a3f5c83f53338cdc5885613b86176526135913f74b5f40cff50c41c743d3a18d108d85d82159a5b2e61a3198b4781d954ffbe4757b8e936974870
7
+ data.tar.gz: 529778eb06aa4036e8157a67c69c757c6555a86b6c2a1f79d97581862575abf813156ecba9d6c53b48e05253245bebecea7d93446fd714e14676e88a7dbf0997
@@ -47,7 +47,7 @@ module Jarbs
47
47
  project_exists?(name, remove: options.force)
48
48
  lambda_exists?(lambda, remove: options.force)
49
49
 
50
- generate_project(name) unless jarbs_project?
50
+ ProjectGenerator.new(name).generate unless jarbs_project?
51
51
  lambda.generate
52
52
  end
53
53
  end
@@ -129,17 +129,5 @@ module Jarbs
129
129
  File.exists?('.jarbs')
130
130
  end
131
131
 
132
- def generate_project(name)
133
- ProjectGenerator.new(name).generate
134
-
135
- # run future commands in the new jarbs dir
136
- Dir.chdir name
137
-
138
- # create a config inside of the new project dir
139
- config = Config.new
140
- autolog = config.get('crashes.report') { agree("Would you like to log jarbs crashes to GitHub automatically (y/n)? ") }
141
-
142
- GithubAuth.new(config).generate_token if autolog
143
- end
144
132
  end
145
133
  end
@@ -3,8 +3,11 @@ module Jarbs
3
3
  include Commander::UI
4
4
  include CrashReporter::DSL
5
5
 
6
+ MIN_NPM_VERSION = 2
7
+
6
8
  def initialize(function)
7
9
  @function = function
10
+ check_npm_version
8
11
  end
9
12
 
10
13
  def npm_install(path, flags="")
@@ -38,5 +41,19 @@ module Jarbs
38
41
  success = system(cmd)
39
42
  abort("cpm runtime exited with non-zero status code: #{$?.exitstatus}") unless success
40
43
  end
44
+
45
+ def check_npm_version
46
+ unless npm_version_major >= MIN_NPM_VERSION
47
+ say_warning "NPM should be at #{MIN_NPM_VERSION}.x or greater (currently #{npm_version})"
48
+ end
49
+ end
50
+
51
+ def npm_version
52
+ @npm_version ||= `npm -v`.chomp
53
+ end
54
+
55
+ def npm_version_major
56
+ npm_version.split('.').first.to_i
57
+ end
41
58
  end
42
59
  end
@@ -29,9 +29,22 @@ module Jarbs
29
29
  }
30
30
 
31
31
  FileUtils.mkdir @name
32
- write_package(manifest, @name)
33
32
 
34
- NodeBuild.new(nil).npm_install(@name)
33
+ Dir.chdir(@name)
34
+
35
+ write_package(manifest, '.')
36
+ NodeBuild.new(nil).npm_install('.')
37
+
38
+ setup_crash_logging
39
+ end
40
+
41
+ def setup_crash_logging
42
+ config = Config.new
43
+ autolog = config.get('crashes.report') do
44
+ agree("Would you like to log jarbs crashes to GitHub automatically (y/n)? ")
45
+ end
46
+
47
+ GithubAuth.new(config).generate_token if autolog
35
48
  end
36
49
  end
37
50
  end
@@ -1,3 +1,3 @@
1
1
  module Jarbs
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jarbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke van der Hoeven
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-09 00:00:00.000000000 Z
11
+ date: 2015-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander