wrapp 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wrapp/app_info.rb +3 -9
- data/lib/wrapp/version.rb +1 -1
- data/lib/wrapp.rb +1 -1
- data/spec/wrapp/app_info_spec.rb +24 -19
- data/wrapp.gemspec +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: caa2b48e6568ce9e7fe82e2dadb45ab812d9e841
|
4
|
+
data.tar.gz: 8ec780d1e205d15cbba9e058a597e40a29b0e830
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2988f61ddf590819b523e552130d9acb2b16bf33835581cae379ab9e65b332c2b694d031e78c0cab1629464c7f7ab43508704a898d8d42927267070f0bea0486
|
7
|
+
data.tar.gz: b5e890e913b625d6e2739c8f63ea4c68dcbfffb66185ee2c84353549bc99311aad78c4f899a6d030e2360475893866bac81be8be1e23ca4b055c8bb23a900236
|
data/lib/wrapp/app_info.rb
CHANGED
@@ -20,15 +20,9 @@ module Wrapp
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def get_property(property)
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
private
|
29
|
-
|
30
|
-
def properties
|
31
|
-
Plist4r.open plist
|
23
|
+
command_line = Cocaine::CommandLine.new('/usr/libexec/PlistBuddy',
|
24
|
+
'-c :cmd :plist')
|
25
|
+
command_line.run(:cmd => "Print #{property}", :plist => plist).strip
|
32
26
|
end
|
33
27
|
end
|
34
28
|
end
|
data/lib/wrapp/version.rb
CHANGED
data/lib/wrapp.rb
CHANGED
data/spec/wrapp/app_info_spec.rb
CHANGED
@@ -4,6 +4,10 @@ module Wrapp
|
|
4
4
|
describe AppInfo do
|
5
5
|
let(:app) { AppInfo.new('Info.plist') }
|
6
6
|
|
7
|
+
before do
|
8
|
+
AppInfo.any_instance.stub(:`)
|
9
|
+
end
|
10
|
+
|
7
11
|
describe '#full_name' do
|
8
12
|
it 'includes the downcased name and version without spaces' do
|
9
13
|
app.stub(:name).and_return("Chunky\t Bacon")
|
@@ -30,29 +34,30 @@ module Wrapp
|
|
30
34
|
end
|
31
35
|
end
|
32
36
|
|
33
|
-
describe '#
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
37
|
+
describe '#get_property' do
|
38
|
+
let(:command_line) { double('command_line', :run => '') }
|
39
|
+
|
40
|
+
before do
|
41
|
+
Cocaine::CommandLine.stub(:new).and_return(command_line)
|
38
42
|
end
|
39
|
-
end
|
40
43
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
44
|
+
it 'builds a new command line object' do
|
45
|
+
Cocaine::CommandLine.should_receive(:new).
|
46
|
+
with('/usr/libexec/PlistBuddy', '-c :cmd :plist').
|
47
|
+
and_return(command_line)
|
48
|
+
app.get_property('Foo')
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'runs the command line with the property' do
|
52
|
+
command_line.should_receive(:run).
|
53
|
+
with(:cmd => 'Print Foo', :plist => 'Info.plist').
|
54
|
+
and_return('')
|
55
|
+
app.get_property('Foo')
|
49
56
|
end
|
50
57
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
expect(app.get_property('Chunky')).to eq('Bacon')
|
55
|
-
end
|
58
|
+
it 'strips the output' do
|
59
|
+
command_line.stub(:run).and_return("Chunky\n")
|
60
|
+
expect(app.get_property('')).to eq('Chunky')
|
56
61
|
end
|
57
62
|
end
|
58
63
|
end
|
data/wrapp.gemspec
CHANGED
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_dependency 'plist4r', '~> 1.2'
|
22
21
|
spec.add_dependency 'mixlib-cli', '~> 1.3'
|
22
|
+
spec.add_dependency 'cocaine', '~> 0.5'
|
23
23
|
|
24
24
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
25
25
|
spec.add_development_dependency 'rake'
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wrapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Björn Albers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: mixlib-cli
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: cocaine
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0.5'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0.5'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -174,7 +174,7 @@ rubyforge_project:
|
|
174
174
|
rubygems_version: 2.0.3
|
175
175
|
signing_key:
|
176
176
|
specification_version: 4
|
177
|
-
summary: wrapp-0.
|
177
|
+
summary: wrapp-0.4.0
|
178
178
|
test_files:
|
179
179
|
- features/step_definitions/wrapp_steps.rb
|
180
180
|
- features/support/app.rb
|