pre-packager 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de0ea591935f7883fd0ad2425b3dcf7a19b6c794
4
- data.tar.gz: 961acfbd2873b8a6b1194c466238a53b3503915b
3
+ metadata.gz: 164b0dfc0cb280890a07cdaa5ce3c3f682f69fdf
4
+ data.tar.gz: 009561bf7f4b253b4edef3f2ceb6c63943a8e660
5
5
  SHA512:
6
- metadata.gz: d2c3dddee3c508e59d356010b20549545492da2397551711adfa6044548d33b811788f18c479d5f9d6627e175ed077dcc52932d26715eb3470d9676f20ebbe95
7
- data.tar.gz: 52bf9263f37ed318b280a5a330c99f8f0865f763412a847e88b138781db75cb4170f02fcc549343292d7d9a1eea7d19efd5a9a04ae492225c705a28bc7f35336
6
+ metadata.gz: f2ae1409edeec63e1e172e4c97f5dd2578adc22cf8f9b3890134034cba3932368d4525c75b2ef7d4fd7ed72f0a083d1c1a26f1455cf571d3d6fbb27e14fb23c0
7
+ data.tar.gz: a23436aa97803ad5843b1b5f1090f5ae140d5f0464d61ffcd2ef96ffc0cea6c87ee55a4e12e4a351b7af79242d0f7c0c5321cee99fe15192158dd7cd35dbbbbe
@@ -1 +1 @@
1
- app-creator
1
+ pre-packager
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
1
  # Pre-Packager
2
+ [![Gem Version](https://badge.fury.io/rb/pre-packager.svg)](http://badge.fury.io/rb/pre-packager)
3
+ [![CI](https://magnum-ci.com/status/42b45d01d68f077a9728a6d4d1f4ec37.png)](https://magnum-ci.com/projects/2192)
2
4
 
3
5
  Creates directory structure for linux applications
4
6
 
@@ -3,17 +3,16 @@
3
3
  require 'pre-packager'
4
4
  include PrePackager
5
5
  Application.new(name: 'ideaIC-$version',
6
- version: '14',
7
- minor_version: '0.2').
8
- download_from 'https://gitlab.com/gmatheu/app-tree-creator/raw/master/mock-files/$name.$minor_version.tar.gz' do |p|
9
- # download_from 'http://download-cf.jetbrains.com/idea/$name.$minor_version.tar.gz' do |p|
10
- p.extract('/opt', strip: 1, use_name: true) do |content|
11
- content.link 'bin/idea.sh', use_name: true
12
- end
13
- end.
14
- with_templates('idea-14-templates/*', '/usr/local/share/applications').
15
- create_package(dry_run: true,
16
- version: '$version.$minor_version',
17
- description: 'IntelliJ Idea $version Community Edition',
18
- maintainer: 'Gonzalo Matheu <gonzalommj@gmail.com>')
6
+ version: '14',
7
+ minor_version: '0.2').
8
+ download_from 'https://gitlab.com/gmatheu/pre-packager/raw/master/mock-files/$name.$minor_version.tar.gz' do |p|
9
+ p.extract('/opt', strip: 1, use_name: true) do |content|
10
+ content.link 'bin/idea.sh', use_name: true
11
+ end
12
+ end.
13
+ with_templates('idea-14-templates/*', '/usr/local/share/applications').
14
+ create_package(dry_run: true,
15
+ version: '$version.$minor_version',
16
+ description: 'IntelliJ Idea $version Community Edition',
17
+ maintainer: 'Gonzalo Matheu <gonzalommj@gmail.com>')
19
18
 
@@ -20,7 +20,10 @@ module PrePackager
20
20
  @@LOGGER = Logger.new
21
21
  def execute cmd
22
22
  @@LOGGER.info "Executing: #{cmd}"
23
- `#{cmd}`
23
+ out = `#{cmd}`
24
+ if $? != 0
25
+ @@LOGGER.info "Output: #{out}"
26
+ end
24
27
  end
25
28
  end
26
29
 
@@ -51,9 +54,10 @@ module PrePackager
51
54
  target = File.join @context.base, @context.name, file
52
55
  linkname = Pathname.new(file).basename.to_s
53
56
  linkname = @context.name if options[:use_name]
54
- link = File.join link_base, linkname
57
+ create_link = proc { |name| File.join link_base, name}
55
58
 
56
- execute "ln -sf #{target} #{link}"
59
+ execute "ln -sf #{target} #{create_link.call(linkname)}"
60
+ execute("ln -sf #{linkname} #{create_link.call(options[:alias])}") if options[:alias]
57
61
  # File.symlink File.join(file), File.join(@path, @@LINK_BASE_DEFAULT, link)
58
62
  end
59
63
  end
@@ -139,7 +143,7 @@ module PrePackager
139
143
  valid_fields = Proc.new { |k, v| @@VALID_FIELDS.include? k}
140
144
  compose_field = Proc.new { |k, v| %Q|--#{k} "#{v}"|}
141
145
  fields = opts.
142
- keep_if(&valid_fields).
146
+ select(&valid_fields).
143
147
  map(&compose_field).
144
148
  join ' '
145
149
  cmd = interpolate %Q|
@@ -1,5 +1,5 @@
1
1
  module App
2
2
  module Creator
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -26,4 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency "pry"
27
27
  spec.add_development_dependency "pry-nav"
28
28
  spec.add_development_dependency "webmock"
29
+ spec.add_development_dependency "fpm"
29
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pre-packager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gonzalo Matheu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-19 00:00:00.000000000 Z
11
+ date: 2015-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: fpm
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  description: 'Provides a DSL to create directories, files and links structure from
126
140
  different sources (e.g: tar.gz, templates)'
127
141
  email:
@@ -168,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
182
  version: '0'
169
183
  requirements: []
170
184
  rubyforge_project:
171
- rubygems_version: 2.4.3
185
+ rubygems_version: 2.4.8
172
186
  signing_key:
173
187
  specification_version: 4
174
188
  summary: Creates directory structure for linux applications