npmfed 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/npmfed +11 -14
- data/lib/npmfed/rpm_package.rb +7 -0
- data/lib/npmfed/version.rb +1 -1
- data/templates/nodejs-fedora.spec.erb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1df0ed3a4a40c9844466e44c67c7cc59ef27aca3
|
4
|
+
data.tar.gz: 8712263478282044a5ff16798bcf55f555254925
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1c6d15f47f57abe41752821b840c40f0f64a2593ed2ffc41e119a352430b471fe81f67a3bd7087e3a47a7f66dba1562e4506345f292b07960c8b05274ce9cc9
|
7
|
+
data.tar.gz: 231a98e3e0a10c523f8842c535a28729e5b2ef434a55ba08c960a3be6dea1a037ed5c579a8311e38581c62b2bbc27fbc15903de3e3f9a560cd7936c0981a2ca3
|
data/bin/npmfed
CHANGED
@@ -11,9 +11,10 @@ class MyCLI < Thor
|
|
11
11
|
option :create, :desc => 'Create directory, download sources from npmjs and generate spec file'
|
12
12
|
option :deps, :desc => 'Used with create will do the same for dependencies'
|
13
13
|
option :scl, :desc => 'Run spec2scl on generated spec file'
|
14
|
+
option :version, :type => :string,:desc => 'Specify version of package you want to create'
|
14
15
|
|
15
|
-
def check(name, version=
|
16
|
-
package = Npmfed::NpmPackage.new name, @debug
|
16
|
+
def check(name, version = options[:version])
|
17
|
+
package = Npmfed::NpmPackage.new name, @debug, version
|
17
18
|
|
18
19
|
puts "#{package.name}-#{package.version} dependencies:"
|
19
20
|
puts "================================================"
|
@@ -48,24 +49,20 @@ class MyCLI < Thor
|
|
48
49
|
dependencies = []
|
49
50
|
package.dependencies.each do |name, data|
|
50
51
|
if data.nil?
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
52
|
+
dependency = Npmfed::NpmPackage.new name, @debug
|
53
|
+
puts name + " DOWNLOADING ".to_s.red
|
54
|
+
FileUtils.mkdir_p "#{package.rpmname}/deps/nodejs-#{name}"
|
55
|
+
tarball_uri = URI dependency.tarball
|
56
|
+
`wget #{tarball_uri} -P "#{package.rpmname}/deps/nodejs-#{name}"/`
|
57
|
+
dep_rpm_package = Npmfed::RpmPackage.new name, dependency, options[:scl]
|
58
|
+
dep_rpm_package.write "#{package.rpmname}/deps/"
|
59
|
+
dependencies << dependency
|
59
60
|
end
|
60
61
|
end
|
61
62
|
end
|
62
63
|
end
|
63
64
|
end
|
64
65
|
|
65
|
-
desc 'test IDES', 'Used for testing shit'
|
66
|
-
def test(name)
|
67
|
-
end
|
68
|
-
|
69
66
|
desc 'download NPM MODULE NAME' , 'downloads latest tarball from npmjs'
|
70
67
|
def download
|
71
68
|
end
|
data/lib/npmfed/rpm_package.rb
CHANGED
@@ -17,6 +17,8 @@ module Npmfed
|
|
17
17
|
result = Array.new
|
18
18
|
deps ||= Hash.new
|
19
19
|
deps.each do |name, version|
|
20
|
+
result << "npm(#{name})"
|
21
|
+
=begin
|
20
22
|
case version
|
21
23
|
# "~1.2.3"
|
22
24
|
when /^~?(\d+(\.\d+)*)(-\d)?([a-z]+)?$/
|
@@ -46,6 +48,7 @@ module Npmfed
|
|
46
48
|
else
|
47
49
|
raise "Unrecognized dependency #{name.inspect}: #{version.inspect}"
|
48
50
|
end
|
51
|
+
=end
|
49
52
|
end
|
50
53
|
result
|
51
54
|
end
|
@@ -124,6 +127,10 @@ module Npmfed
|
|
124
127
|
@npm_package.npm_data["test"]
|
125
128
|
end
|
126
129
|
|
130
|
+
def build
|
131
|
+
@npm_package.npm_data["scripts"].nil? ? '#nothing to do' : @npm_package.npm_data["scripts"]["build"]
|
132
|
+
end
|
133
|
+
|
127
134
|
def write path = nil
|
128
135
|
require 'erb'
|
129
136
|
|
data/lib/npmfed/version.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
%global npm_name <%= spec.npmname %>
|
4
4
|
%{?nodejs_find_provides_and_requires}
|
5
5
|
|
6
|
-
%global enable_tests
|
6
|
+
%global enable_tests 0
|
7
7
|
|
8
8
|
Name: <%= "nodejs-" + spec.npmname %>
|
9
9
|
Version: <%= spec.version %>
|
@@ -54,7 +54,8 @@ Requires: <%= d %>
|
|
54
54
|
rm -rf node_modules
|
55
55
|
|
56
56
|
%build
|
57
|
-
|
57
|
+
|
58
|
+
<%= spec.build %>
|
58
59
|
|
59
60
|
%install
|
60
61
|
mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: npmfed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Hrcka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|