firebrew 0.1.1 → 0.1.2

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: 5a542b1a8f741b5c1e6def0a8086d9c79d68f67e
4
- data.tar.gz: a029dfe002d81c711026d3ea9df4fbe2f2d9fe0c
3
+ metadata.gz: d60374125f704299bad2102f82186e95397ebd26
4
+ data.tar.gz: 11c9f75973a885d728e389f0383f0b33f2b690c2
5
5
  SHA512:
6
- metadata.gz: c46210782bdf747211f0f9a18c86ea35dcacd99d831ead9817dfcb8870f0598aa41894a5a4d9c5f1778cb743b484a249b019d586bd82a6ce4698bea436a2155a
7
- data.tar.gz: 59ad9eef3e13be8c5f4f21926374464d2f7ad0b34c5e02e73dd42f409d0487f457fcc64c777f2560a85a42e8740b3fd76bcbb44a0ea591cf8770d22d96a7e392
6
+ metadata.gz: d480f31e469ef6bd6b3f3fcd108138cc455b3cd4adf76e3c7c0308162011c5c7a18ea4ecd882ec8e82f6e11868932402f4ed64284f41fb46d7d0266f366e40e4
7
+ data.tar.gz: d513c0fcaf40b6fe92d32c522e2ea577a24727c446c6182715985952ff109282494db9ab1d58123ed038690fcf31e73212dec6c2266bfc04cc150e186105c059
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ ## [0.1.2](https://github.com/mrk21/firebrew/tree/v0.1.2) - 2014-08-15
4
+
5
+ * Bugfix [#23](https://github.com/mrk21/firebrew/issues/23): If the `install` element of the extension which was got by the generic AMO API was equal or greater than two, then occurs errors
6
+ * Future [#22](https://github.com/mrk21/firebrew/issues/22): Designate the current platform to the `os` parameter when use the `Amo::Search`
7
+
8
+ ## [0.1.1](https://github.com/mrk21/firebrew/tree/v0.1.1) - 2014-07-16
9
+
10
+ * Bugfix [#12](https://github.com/mrk21/firebrew/issues/12): The unit test failed on the Windows(#10): The 2 to 5 errors
11
+ * Bugfix [#11](https://github.com/mrk21/firebrew/issues/11): The unit test failed on the Windows(#10): The first error
12
+ * Bugfix [#9](https://github.com/mrk21/firebrew/issues/9): Is not able to install on the profile creation immediate aftermath
13
+ * Bugfix [#8](https://github.com/mrk21/firebrew/issues/8): The typo of the `Runner::default_options` for the Windows
@@ -42,7 +42,7 @@ module Firebrew::Firefox
42
42
  FileUtils.mkdir_p dir
43
43
  install_path = '%s.xpi' % File.join(dir, extension.guid)
44
44
 
45
- open(extension.uri, 'rb') do |i|
45
+ open([extension.uri].flatten.first, 'rb') do |i|
46
46
  open(install_path, 'wb') do |o|
47
47
  o.write i.read
48
48
  end
@@ -17,16 +17,19 @@ module Firebrew
17
17
  when /darwin/ then
18
18
  result[:base_dir] ||= '~/Library/Application Support/Firefox'
19
19
  result[:firefox] ||= '/Applications/Firefox.app/Contents/MacOS/firefox-bin'
20
+ result[:os] = 'darwin'
20
21
 
21
22
  when /linux/ then
22
23
  result[:base_dir] ||= '~/.mozilla/firefox'
23
24
  result[:firefox] ||= '/usr/bin/firefox'
25
+ result[:os] = 'linux'
24
26
 
25
27
  when /mswin(?!ce)|mingw|cygwin|bccwin/ then
26
28
  appdata = ENV['APPDATA'].to_s.gsub('\\','/')
27
29
  programfiles = (ENV['PROGRAMFILES(X86)'] || ENV['PROGRAMFILES']).to_s.gsub('\\','/')
28
30
  result[:base_dir] ||= File.join(appdata, 'Mozilla/Firefox')
29
31
  result[:firefox] ||= File.join(programfiles, 'Mozilla Firefox/firefox.exe')
32
+ result[:os] = 'winnt'
30
33
  end
31
34
 
32
35
  result
@@ -78,7 +81,7 @@ module Firebrew
78
81
  protected
79
82
 
80
83
  def fetch_api(params={})
81
- params.merge!(version: @firefox.version)
84
+ params.merge!(version: @firefox.version, os: self.config[:os])
82
85
  AmoApi::Search.fetch!(params)
83
86
  end
84
87
  end
@@ -1,3 +1,3 @@
1
1
  module Firebrew
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -87,7 +87,7 @@ module Firebrew::Firefox
87
87
  end
88
88
 
89
89
  describe '#install(extension)' do
90
- before { self.instance.install(self.extension) }
90
+ subject { self.instance.install(self.extension) }
91
91
 
92
92
  let(:extension) do
93
93
  Extension.new({
@@ -97,11 +97,13 @@ module Firebrew::Firefox
97
97
  end
98
98
 
99
99
  it 'should copy the `path/to/profile/extensions/guid.xpi`' do
100
+ subject
100
101
  path = File.join(self.instance.profile.path, 'extensions/%s.xpi' % self.extension.guid)
101
102
  expect(File.exists? path).to be_truthy
102
103
  end
103
104
 
104
105
  it 'should add the `extension` extension' do
106
+ subject
105
107
  all = self.instance.all
106
108
  extension = self.extension
107
109
  extension.uri = './tmp/extensions/hoge@example.org.xpi'
@@ -110,6 +112,22 @@ module Firebrew::Firefox
110
112
  expect(all[1]).to eq(self.extensions[1])
111
113
  expect(all[2]).to eq(self.extension)
112
114
  end
115
+
116
+ context 'when an `uri` of the `extension` was equal or greater than two' do
117
+ let(:extension) do
118
+ Extension.new({
119
+ guid: 'hoge@example.org',
120
+ uri: [
121
+ './spec/fixtures/amo_api/search/base.xml',
122
+ './spec/fixtures/amo_api/search/not_exists.xml'
123
+ ]
124
+ }, self.manager)
125
+ end
126
+
127
+ it 'should not throw exceptions' do
128
+ expect{subject}.to_not raise_error
129
+ end
130
+ end
113
131
  end
114
132
 
115
133
  describe '#uninstall(extension)' do
@@ -7,7 +7,7 @@ module Firebrew
7
7
  Runner.default_config(self.platform)
8
8
  end
9
9
 
10
- let(:platform){RUBY_PLATFORM}
10
+ let(:platform){'x86_64-darwin13.0'}
11
11
 
12
12
  before do
13
13
  ENV['FIREBREW_FIREFOX_PROFILE_BASE_DIR'] = nil
@@ -27,7 +27,8 @@ module Firebrew
27
27
  is_expected.to eq(
28
28
  base_dir: '~/Library/Application Support/Firefox',
29
29
  firefox: '/Applications/Firefox.app/Contents/MacOS/firefox-bin',
30
- profile: 'default'
30
+ profile: 'default',
31
+ os: 'darwin'
31
32
  )
32
33
  end
33
34
  end
@@ -38,7 +39,8 @@ module Firebrew
38
39
  is_expected.to eq(
39
40
  base_dir: '~/.mozilla/firefox',
40
41
  firefox: '/usr/bin/firefox',
41
- profile: 'default'
42
+ profile: 'default',
43
+ os: 'linux'
42
44
  )
43
45
  end
44
46
  end
@@ -70,7 +72,8 @@ module Firebrew
70
72
  is_expected.to eq(
71
73
  base_dir: 'C:/Users/admin/AppData/Roaming/Mozilla/Firefox',
72
74
  firefox: 'C:/Program Files (x86)/Mozilla Firefox/firefox.exe',
73
- profile: 'default'
75
+ profile: 'default',
76
+ os: 'winnt'
74
77
  )
75
78
  end
76
79
  end
@@ -86,7 +89,8 @@ module Firebrew
86
89
  is_expected.to eq(
87
90
  base_dir: 'C:/Documents and Settings/Administrator/Application Data/Mozilla/Firefox',
88
91
  firefox: 'C:/Program Files/Mozilla Firefox/firefox.exe',
89
- profile: 'default'
92
+ profile: 'default',
93
+ os: 'winnt'
90
94
  )
91
95
  end
92
96
  end
@@ -104,7 +108,8 @@ module Firebrew
104
108
  is_expected.to eq(
105
109
  base_dir: 'C:/Users/admin/AppData/Roaming/Mozilla/Firefox',
106
110
  firefox: 'C:/Program Files (x86)/Mozilla Firefox/firefox.exe',
107
- profile: 'default'
111
+ profile: 'default',
112
+ os: 'winnt'
108
113
  )
109
114
  end
110
115
  end
@@ -122,7 +127,8 @@ module Firebrew
122
127
  is_expected.to eq(
123
128
  base_dir: 'path/to/profile_base_directory',
124
129
  firefox: 'path/to/firefox',
125
- profile: 'profile-name'
130
+ profile: 'profile-name',
131
+ os: 'darwin'
126
132
  )
127
133
  end
128
134
  end
@@ -139,7 +145,7 @@ module Firebrew
139
145
  )
140
146
  end
141
147
 
142
- let(:search_params){{term: 'hoge', version: '30.0', max: 1}}
148
+ let(:search_params){{term: 'hoge', version: '30.0', max: 1, os: Runner.default_config[:os]}}
143
149
 
144
150
  before do
145
151
  FileUtils.cp './spec/fixtures/firefox/profile/base.ini', './tmp/profiles.ini'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firebrew
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuichi Murata
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-15 00:00:00.000000000 Z
11
+ date: 2014-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -119,6 +119,7 @@ files:
119
119
  - ".gitignore"
120
120
  - ".rspec"
121
121
  - ".travis.yml"
122
+ - CHANGELOG.md
122
123
  - Gemfile
123
124
  - LICENSE.txt
124
125
  - README.md