firebrew 0.1.0

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.
Files changed (38) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +3 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +127 -0
  8. data/Rakefile +6 -0
  9. data/bin/firebrew +5 -0
  10. data/firebrew.gemspec +29 -0
  11. data/lib/firebrew.rb +20 -0
  12. data/lib/firebrew/amo_api/search.rb +50 -0
  13. data/lib/firebrew/command_line.rb +140 -0
  14. data/lib/firebrew/entity.rb +39 -0
  15. data/lib/firebrew/firefox/basic_extension.rb +10 -0
  16. data/lib/firebrew/firefox/command.rb +27 -0
  17. data/lib/firebrew/firefox/extension.rb +104 -0
  18. data/lib/firebrew/firefox/profile.rb +56 -0
  19. data/lib/firebrew/runner.rb +83 -0
  20. data/lib/firebrew/version.rb +3 -0
  21. data/spec/double/firefox.rb +2 -0
  22. data/spec/firebrew/amo_api/search_spec.rb +69 -0
  23. data/spec/firebrew/command_line_spec.rb +150 -0
  24. data/spec/firebrew/entity_spec.rb +79 -0
  25. data/spec/firebrew/firefox/command_spec.rb +39 -0
  26. data/spec/firebrew/firefox/extension_spec.rb +159 -0
  27. data/spec/firebrew/firefox/profile_spec.rb +69 -0
  28. data/spec/firebrew/runner_spec.rb +142 -0
  29. data/spec/firebrew_spec.rb +7 -0
  30. data/spec/fixtures/amo_api/search/base.xml +28 -0
  31. data/spec/fixtures/amo_api/search/empty.xml +4 -0
  32. data/spec/fixtures/amo_api/search/single.xml +12 -0
  33. data/spec/fixtures/firefox/extension/extensions.v16.json +227 -0
  34. data/spec/fixtures/firefox/extension/extensions_added_hoge.v16.json +235 -0
  35. data/spec/fixtures/firefox/profile/base.ini +18 -0
  36. data/spec/fixtures/firefox/profile/empty.ini +2 -0
  37. data/spec/spec_helper.rb +13 -0
  38. metadata +196 -0
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe Firebrew do
4
+ it 'should have a version number' do
5
+ expect(Firebrew::VERSION).to_not be_nil
6
+ end
7
+ end
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <!-- The generic AMO API 1.5: Search API result. This result is minimum structure. -->
3
+ <!-- url: https://services.addons.mozilla.org/ja/firefox/api/1.5/search/hoge -->
4
+ <searchresults total_results="3">
5
+ <addon id="100">
6
+ <name>hoge</name>
7
+ <guid>hoge-ja@example.org</guid>
8
+ <version>10.0</version>
9
+ <install hash="sha256:57d1d245faafe6026b5ac79558b98a82761446c026ed5b0b22304114366f1bb1" os="ALL" size="448"
10
+ >https://addons.mozilla.org/firefox/downloads/file/2000/hoge.xpi?src=api</install>
11
+ </addon>
12
+
13
+ <addon id="101">
14
+ <name>hoge_fuga</name>
15
+ <guid>hoge-fuga-ja@example.org</guid>
16
+ <version>2.3</version>
17
+ <install hash="sha256:57d1d245faafe6026b5ac79558b98a82761446c026ed5b0b22304114366f1bb1" os="ALL" size="448"
18
+ >https://addons.mozilla.org/firefox/downloads/file/2001/hoge_fuga.xpi?src=api</install>
19
+ </addon>
20
+
21
+ <addon id="102">
22
+ <name>hoge_hoge</name>
23
+ <guid>hoge-hoge-ja@example.org</guid>
24
+ <version>0.8</version>
25
+ <install hash="sha256:57d1d245faafe6026b5ac79558b98a82761446c026ed5b0b22304114366f1bb1" os="ALL" size="448"
26
+ >https://addons.mozilla.org/firefox/downloads/file/2002/hoge_hoge.xpi?src=api</install>
27
+ </addon>
28
+ </searchresults>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <!-- The generic AMO API 1.5: Search API result. This result is empty. -->
3
+ <!-- url: https://services.addons.mozilla.org/ja/firefox/api/1.5/search/hoge -->
4
+ <searchresults total_results="0"></searchresults>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <!-- The generic AMO API 1.5: Search API result. This result is minimum structure. -->
3
+ <!-- url: https://services.addons.mozilla.org/ja/firefox/api/1.5/search/hoge -->
4
+ <searchresults total_results="1">
5
+ <addon id="100">
6
+ <name>hoge</name>
7
+ <guid>hoge-ja@example.org</guid>
8
+ <version>10.0</version>
9
+ <install hash="sha256:57d1d245faafe6026b5ac79558b98a82761446c026ed5b0b22304114366f1bb1" os="ALL" size="448"
10
+ >https://addons.mozilla.org/firefox/downloads/file/2000/hoge.xpi?src=api</install>
11
+ </addon>
12
+ </searchresults>
@@ -0,0 +1,227 @@
1
+ {
2
+ "schemaVersion": 16,
3
+ "addons": [
4
+ {
5
+ "id": "{972ce4c6-7e08-4474-a285-3208198ce6fd}",
6
+ "syncGUID": "I3nq6ifLBqr9",
7
+ "location": "app-global",
8
+ "version": "30.0",
9
+ "type": "theme",
10
+ "internalName": "classic/1.0",
11
+ "updateURL": null,
12
+ "updateKey": null,
13
+ "optionsURL": null,
14
+ "optionsType": null,
15
+ "aboutURL": null,
16
+ "iconURL": null,
17
+ "icon64URL": null,
18
+ "defaultLocale": {
19
+ "name": "Default",
20
+ "description": "The default theme.",
21
+ "creator": "Mozilla",
22
+ "homepageURL": null,
23
+ "contributors": [
24
+ "Mozilla Contributors"
25
+ ]
26
+ },
27
+ "visible": true,
28
+ "active": true,
29
+ "userDisabled": false,
30
+ "appDisabled": false,
31
+ "descriptor": "/Applications/Firefox.app/Contents/MacOS/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}",
32
+ "installDate": 1402021782000,
33
+ "updateDate": 1402021782000,
34
+ "applyBackgroundUpdates": 1,
35
+ "skinnable": true,
36
+ "size": 3504,
37
+ "sourceURI": null,
38
+ "releaseNotesURI": null,
39
+ "softDisabled": false,
40
+ "foreignInstall": false,
41
+ "hasBinaryComponents": false,
42
+ "strictCompatibility": true,
43
+ "locales": [
44
+
45
+ ],
46
+ "targetApplications": [
47
+ {
48
+ "id": "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
49
+ "minVersion": "30.0",
50
+ "maxVersion": "30.0"
51
+ }
52
+ ],
53
+ "targetPlatforms": [
54
+
55
+ ]
56
+ },
57
+ {
58
+ "id": "web2pdfextension@web2pdf.adobedotcom",
59
+ "syncGUID": "VaECJg81_aro",
60
+ "location": "app-system-local",
61
+ "version": "2.0",
62
+ "type": "extension",
63
+ "internalName": null,
64
+ "updateURL": null,
65
+ "updateKey": null,
66
+ "optionsURL": null,
67
+ "optionsType": null,
68
+ "aboutURL": null,
69
+ "iconURL": "chrome://web2pdfextension/skin/C_AdobeLogo_48x48.png",
70
+ "icon64URL": "chrome://web2pdfextension/skin/C_AdobeLogo_64x64.png",
71
+ "defaultLocale": {
72
+ "name": "Adobe Acrobat - Create PDF",
73
+ "description": "Converts a web page to PDF",
74
+ "creator": "Adobe Systems Incorporated",
75
+ "homepageURL": "http://www.adobe.com/"
76
+ },
77
+ "visible": true,
78
+ "active": false,
79
+ "userDisabled": true,
80
+ "appDisabled": false,
81
+ "descriptor": "/Library/Application Support/Mozilla/Extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/web2pdfextension@web2pdf.adobedotcom",
82
+ "installDate": 1403953198000,
83
+ "updateDate": 1403953198000,
84
+ "applyBackgroundUpdates": 1,
85
+ "bootstrap": false,
86
+ "size": 135272,
87
+ "sourceURI": null,
88
+ "releaseNotesURI": null,
89
+ "softDisabled": false,
90
+ "foreignInstall": true,
91
+ "hasBinaryComponents": false,
92
+ "strictCompatibility": false,
93
+ "locales": [
94
+
95
+ ],
96
+ "targetApplications": [
97
+ {
98
+ "id": "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
99
+ "minVersion": "4.0",
100
+ "maxVersion": "*.*"
101
+ }
102
+ ],
103
+ "targetPlatforms": [
104
+
105
+ ]
106
+ },
107
+ {
108
+ "id": "langpack-ja@firefox.mozilla.org",
109
+ "syncGUID": "B_Y3qm7NsEDZ",
110
+ "location": "app-profile",
111
+ "version": "30.0",
112
+ "type": "locale",
113
+ "internalName": null,
114
+ "updateURL": null,
115
+ "updateKey": null,
116
+ "optionsURL": null,
117
+ "optionsType": null,
118
+ "aboutURL": null,
119
+ "iconURL": null,
120
+ "icon64URL": null,
121
+ "defaultLocale": {
122
+ "name": "Japanese Language Pack",
123
+ "description": null,
124
+ "creator": "Mozilla Japanese L10N Community",
125
+ "homepageURL": null,
126
+ "contributors": [
127
+ "Hiroki Abe",
128
+ "Makoto Arai",
129
+ "Tomoya Asai",
130
+ "Hideyuki EMURA",
131
+ "Shaw Hosaka",
132
+ "Joji Ikeda",
133
+ "Masahiko Imanaka",
134
+ "Kosuke Kaizuka",
135
+ "Hidehiro Kozawa",
136
+ "Teiji Matsuba",
137
+ "Shigeki Narisawa",
138
+ "Takeshi Nishimura",
139
+ "Toshiyuki Oka",
140
+ "Atsushi Sakai",
141
+ "Hiroshi Sekiya",
142
+ "Youhei Tooyama",
143
+ "Satoru Yamaguchi"
144
+ ]
145
+ },
146
+ "visible": true,
147
+ "active": true,
148
+ "userDisabled": false,
149
+ "appDisabled": false,
150
+ "descriptor": "/Users/yuichi/Library/Application Support/Firefox/Profiles/k9l2swsk.default/extensions/langpack-ja@firefox.mozilla.org.xpi",
151
+ "installDate": 1404466078000,
152
+ "updateDate": 1404626257000,
153
+ "applyBackgroundUpdates": 1,
154
+ "bootstrap": true,
155
+ "size": 954430,
156
+ "sourceURI": null,
157
+ "releaseNotesURI": null,
158
+ "softDisabled": false,
159
+ "foreignInstall": false,
160
+ "hasBinaryComponents": false,
161
+ "strictCompatibility": true,
162
+ "locales": [
163
+
164
+ ],
165
+ "targetApplications": [
166
+ {
167
+ "id": "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
168
+ "minVersion": "30.0",
169
+ "maxVersion": "30.*"
170
+ }
171
+ ],
172
+ "targetPlatforms": [
173
+
174
+ ]
175
+ },
176
+ {
177
+ "id": "vimperator@mozdev.org",
178
+ "syncGUID": "3Z1gn5NFJXqC",
179
+ "location": "app-profile",
180
+ "version": "3.8.2",
181
+ "type": "extension",
182
+ "internalName": null,
183
+ "updateURL": null,
184
+ "updateKey": null,
185
+ "optionsURL": "chrome://liberator/content/preferences.xul",
186
+ "optionsType": null,
187
+ "aboutURL": null,
188
+ "iconURL": "chrome://vimperator/skin/icon.png",
189
+ "icon64URL": null,
190
+ "defaultLocale": {
191
+ "name": "Vimperator",
192
+ "description": "Vimperator adds an efficient, Vim-inspired user interface on top of Firefox",
193
+ "creator": "Martin Stubenschrott",
194
+ "homepageURL": "http://vimperator.org"
195
+ },
196
+ "visible": true,
197
+ "active": true,
198
+ "userDisabled": false,
199
+ "appDisabled": false,
200
+ "descriptor": "/Users/yuichi/Library/Application Support/Firefox/Profiles/k9l2swsk.default/extensions/vimperator@mozdev.org.xpi",
201
+ "installDate": 1404474084000,
202
+ "updateDate": 1404617815000,
203
+ "applyBackgroundUpdates": 1,
204
+ "bootstrap": false,
205
+ "size": 1509840,
206
+ "sourceURI": null,
207
+ "releaseNotesURI": null,
208
+ "softDisabled": false,
209
+ "foreignInstall": true,
210
+ "hasBinaryComponents": false,
211
+ "strictCompatibility": false,
212
+ "locales": [
213
+
214
+ ],
215
+ "targetApplications": [
216
+ {
217
+ "id": "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
218
+ "minVersion": "17.0",
219
+ "maxVersion": "30.*"
220
+ }
221
+ ],
222
+ "targetPlatforms": [
223
+
224
+ ]
225
+ }
226
+ ]
227
+ }
@@ -0,0 +1,235 @@
1
+ {
2
+ "schemaVersion": 16,
3
+ "addons": [
4
+ {
5
+ "id": "{972ce4c6-7e08-4474-a285-3208198ce6fd}",
6
+ "syncGUID": "I3nq6ifLBqr9",
7
+ "location": "app-global",
8
+ "version": "30.0",
9
+ "type": "theme",
10
+ "internalName": "classic/1.0",
11
+ "updateURL": null,
12
+ "updateKey": null,
13
+ "optionsURL": null,
14
+ "optionsType": null,
15
+ "aboutURL": null,
16
+ "iconURL": null,
17
+ "icon64URL": null,
18
+ "defaultLocale": {
19
+ "name": "Default",
20
+ "description": "The default theme.",
21
+ "creator": "Mozilla",
22
+ "homepageURL": null,
23
+ "contributors": [
24
+ "Mozilla Contributors"
25
+ ]
26
+ },
27
+ "visible": true,
28
+ "active": true,
29
+ "userDisabled": false,
30
+ "appDisabled": false,
31
+ "descriptor": "/Applications/Firefox.app/Contents/MacOS/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}",
32
+ "installDate": 1402021782000,
33
+ "updateDate": 1402021782000,
34
+ "applyBackgroundUpdates": 1,
35
+ "skinnable": true,
36
+ "size": 3504,
37
+ "sourceURI": null,
38
+ "releaseNotesURI": null,
39
+ "softDisabled": false,
40
+ "foreignInstall": false,
41
+ "hasBinaryComponents": false,
42
+ "strictCompatibility": true,
43
+ "locales": [
44
+
45
+ ],
46
+ "targetApplications": [
47
+ {
48
+ "id": "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
49
+ "minVersion": "30.0",
50
+ "maxVersion": "30.0"
51
+ }
52
+ ],
53
+ "targetPlatforms": [
54
+
55
+ ]
56
+ },
57
+ {
58
+ "id": "web2pdfextension@web2pdf.adobedotcom",
59
+ "syncGUID": "VaECJg81_aro",
60
+ "location": "app-system-local",
61
+ "version": "2.0",
62
+ "type": "extension",
63
+ "internalName": null,
64
+ "updateURL": null,
65
+ "updateKey": null,
66
+ "optionsURL": null,
67
+ "optionsType": null,
68
+ "aboutURL": null,
69
+ "iconURL": "chrome://web2pdfextension/skin/C_AdobeLogo_48x48.png",
70
+ "icon64URL": "chrome://web2pdfextension/skin/C_AdobeLogo_64x64.png",
71
+ "defaultLocale": {
72
+ "name": "Adobe Acrobat - Create PDF",
73
+ "description": "Converts a web page to PDF",
74
+ "creator": "Adobe Systems Incorporated",
75
+ "homepageURL": "http://www.adobe.com/"
76
+ },
77
+ "visible": true,
78
+ "active": false,
79
+ "userDisabled": true,
80
+ "appDisabled": false,
81
+ "descriptor": "/Library/Application Support/Mozilla/Extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/web2pdfextension@web2pdf.adobedotcom",
82
+ "installDate": 1403953198000,
83
+ "updateDate": 1403953198000,
84
+ "applyBackgroundUpdates": 1,
85
+ "bootstrap": false,
86
+ "size": 135272,
87
+ "sourceURI": null,
88
+ "releaseNotesURI": null,
89
+ "softDisabled": false,
90
+ "foreignInstall": true,
91
+ "hasBinaryComponents": false,
92
+ "strictCompatibility": false,
93
+ "locales": [
94
+
95
+ ],
96
+ "targetApplications": [
97
+ {
98
+ "id": "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
99
+ "minVersion": "4.0",
100
+ "maxVersion": "*.*"
101
+ }
102
+ ],
103
+ "targetPlatforms": [
104
+
105
+ ]
106
+ },
107
+ {
108
+ "id": "langpack-ja@firefox.mozilla.org",
109
+ "syncGUID": "B_Y3qm7NsEDZ",
110
+ "location": "app-profile",
111
+ "version": "30.0",
112
+ "type": "locale",
113
+ "internalName": null,
114
+ "updateURL": null,
115
+ "updateKey": null,
116
+ "optionsURL": null,
117
+ "optionsType": null,
118
+ "aboutURL": null,
119
+ "iconURL": null,
120
+ "icon64URL": null,
121
+ "defaultLocale": {
122
+ "name": "Japanese Language Pack",
123
+ "description": null,
124
+ "creator": "Mozilla Japanese L10N Community",
125
+ "homepageURL": null,
126
+ "contributors": [
127
+ "Hiroki Abe",
128
+ "Makoto Arai",
129
+ "Tomoya Asai",
130
+ "Hideyuki EMURA",
131
+ "Shaw Hosaka",
132
+ "Joji Ikeda",
133
+ "Masahiko Imanaka",
134
+ "Kosuke Kaizuka",
135
+ "Hidehiro Kozawa",
136
+ "Teiji Matsuba",
137
+ "Shigeki Narisawa",
138
+ "Takeshi Nishimura",
139
+ "Toshiyuki Oka",
140
+ "Atsushi Sakai",
141
+ "Hiroshi Sekiya",
142
+ "Youhei Tooyama",
143
+ "Satoru Yamaguchi"
144
+ ]
145
+ },
146
+ "visible": true,
147
+ "active": true,
148
+ "userDisabled": false,
149
+ "appDisabled": false,
150
+ "descriptor": "/Users/yuichi/Library/Application Support/Firefox/Profiles/k9l2swsk.default/extensions/langpack-ja@firefox.mozilla.org.xpi",
151
+ "installDate": 1404466078000,
152
+ "updateDate": 1404626257000,
153
+ "applyBackgroundUpdates": 1,
154
+ "bootstrap": true,
155
+ "size": 954430,
156
+ "sourceURI": null,
157
+ "releaseNotesURI": null,
158
+ "softDisabled": false,
159
+ "foreignInstall": false,
160
+ "hasBinaryComponents": false,
161
+ "strictCompatibility": true,
162
+ "locales": [
163
+
164
+ ],
165
+ "targetApplications": [
166
+ {
167
+ "id": "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
168
+ "minVersion": "30.0",
169
+ "maxVersion": "30.*"
170
+ }
171
+ ],
172
+ "targetPlatforms": [
173
+
174
+ ]
175
+ },
176
+ {
177
+ "id": "vimperator@mozdev.org",
178
+ "syncGUID": "3Z1gn5NFJXqC",
179
+ "location": "app-profile",
180
+ "version": "3.8.2",
181
+ "type": "extension",
182
+ "internalName": null,
183
+ "updateURL": null,
184
+ "updateKey": null,
185
+ "optionsURL": "chrome://liberator/content/preferences.xul",
186
+ "optionsType": null,
187
+ "aboutURL": null,
188
+ "iconURL": "chrome://vimperator/skin/icon.png",
189
+ "icon64URL": null,
190
+ "defaultLocale": {
191
+ "name": "Vimperator",
192
+ "description": "Vimperator adds an efficient, Vim-inspired user interface on top of Firefox",
193
+ "creator": "Martin Stubenschrott",
194
+ "homepageURL": "http://vimperator.org"
195
+ },
196
+ "visible": true,
197
+ "active": true,
198
+ "userDisabled": false,
199
+ "appDisabled": false,
200
+ "descriptor": "/Users/yuichi/Library/Application Support/Firefox/Profiles/k9l2swsk.default/extensions/vimperator@mozdev.org.xpi",
201
+ "installDate": 1404474084000,
202
+ "updateDate": 1404617815000,
203
+ "applyBackgroundUpdates": 1,
204
+ "bootstrap": false,
205
+ "size": 1509840,
206
+ "sourceURI": null,
207
+ "releaseNotesURI": null,
208
+ "softDisabled": false,
209
+ "foreignInstall": true,
210
+ "hasBinaryComponents": false,
211
+ "strictCompatibility": false,
212
+ "locales": [
213
+
214
+ ],
215
+ "targetApplications": [
216
+ {
217
+ "id": "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
218
+ "minVersion": "17.0",
219
+ "maxVersion": "30.*"
220
+ }
221
+ ],
222
+ "targetPlatforms": [
223
+
224
+ ]
225
+ },
226
+ {
227
+ "id": "hoge@example.org",
228
+ "location": "app-profile",
229
+ "version": null,
230
+ "defaultLocale": {
231
+ "name": null
232
+ }
233
+ }
234
+ ]
235
+ }