extensionator 1.1.0 → 1.1.1

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: 3780dd6f297b930567d87ad3db41b44f43702759
4
- data.tar.gz: 9ac68018622dff9e312be10be2cfe97522ec35e2
3
+ metadata.gz: 6f228953265e76ab390c3ebeb2fe6d9e18c27fbd
4
+ data.tar.gz: b354884cce12724b56979fe5975ed9b0933d0c43
5
5
  SHA512:
6
- metadata.gz: 7806db009edfc01d8e56a9aced37d2e287b2b37293464977d49b1e748cfedef0e5da1665bd7f709cd8dffcf91cea4e6234c12b982eadabd1bcbaac8ff2368bfa
7
- data.tar.gz: 61eb7af4225a22e2397baf1427507ece88a658c630c22d00c6cd5d53bb7ff22e28d7cbdfaba5f5e4bcd40c120661dbfe196de15eccfd69ee82500966f8c47a6c
6
+ metadata.gz: 27be9ac6fdc50941a5c7f206a20867df9a24ec403d6f54f8b37e3493e13ae3b402190fc312a6836a2aa0839ee245e64902d5a59a4bdd202c695199b27fe05f4d
7
+ data.tar.gz: 7090dec70551fab36c7f7196ef00c7b1053c1643ddfd399c981ef9c8a05b5c053ab4c7b548ea8efd25b428f677eac6e1dbaab4b13f3bbabb04dcdb1a0ccdb636
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Extensionator
2
2
 
3
- Package Chrome extensions. Inspired by [crxmake][crxmake-url], but with an eye towards simplicity and supportability. Use the CLI or the Ruby API.
3
+ Package Chrome extensions. Zip files or CRXs. Some convenience options. Use the command line or Ruby API.
4
4
 
5
5
  [![Gem Version][gem-image]][gem-url]
6
6
  [![MIT License][license-image]][license]
@@ -15,15 +15,15 @@ Package Chrome extensions. Inspired by [crxmake][crxmake-url], but with an eye t
15
15
  gem install extensionator
16
16
  ```
17
17
 
18
- ## What you need
18
+ ## Keys
19
19
 
20
- You need a private key so sign the extension with, and this is a BYOK (bring your own key) library. So first, you need a PEM file. If you have one, cool. If not, do this:
20
+ If you plan on generating a CRX (as opposed to just a zip file to upload somewhere), you need a private key so sign the extension with, and this is a BYOK (bring your own key) library. So first, you need a PEM file. If you have one, cool. If not, do this:
21
21
 
22
22
  ```
23
23
  openssl genrsa -out key.pem 2048
24
24
  ```
25
25
 
26
- You'll also need a directory to package up. Extensionator doesn't pay any attention to the contents; it just repackages them. So if you're misssing a `manifest.json` or your files are encoded wrong or whatever, you won't find out until you try to load the packed extension into Chrome.
26
+ That's the file you'll use as `key.pem` below.
27
27
 
28
28
  ## Command line
29
29
 
@@ -31,23 +31,30 @@ You'll also need a directory to package up. Extensionator doesn't pay any attent
31
31
  extensionator -d directory/with/extension -i key.pem -o output.crx
32
32
  ```
33
33
 
34
- You can also exclude files with a regex, which will be applied to each level of the path (so if you have `foo/bar/baz.stuff`, we compare the regex to "foo", "foo/bar", and "foo/bar/baz.stuff"):
34
+ Useful options! There are single-letter versions of most of these:
35
35
 
36
- ```
37
- extensionator -d directory/with/extension -i key.pem -o output.crx -e "\.md$"
38
- ```
36
+ * `-e` `--exclude`. Specify a regex of things to exclude. Matches on the whole path. `-e "\.md$"
37
+
38
+ * `-f` `--format`. "zip" or "crx". Zip is what the Chrome store has you upload, since it does its own signing. You won't need the `-i` option unless you do something weird with the other options.
39
+
40
+ * `--inject-key`. If you have an extension in the store, you know you can't have a "key" property in your manifest file. But if you do local developmentand want to keep your extension ID the same, you need that property in there. This is because Google hates you and wants to make your life hard. Fortunately, Extensionator can take your pem file, generate the public key, and put it in the manifest file before zipping up the extension. Yay!
41
+
42
+ * `--inject-version`. Use this to override the "version" property in your manifest.
39
43
 
40
- If you're one of *those* people, here's this thing:
44
+ Here's the whole shebang:
41
45
 
42
46
  ```
43
- -> extensionator -h
47
+ -> extensionator --help
44
48
  usage: /Users/isaac/.gem/ruby/2.1.5/bin/extensionator [options]
45
- -d, --directory Directory containing the extension. (Default: .)
46
- -i, --identity Location of the pem file to sign with. (Required)
47
- -o, --output Location of the output file. (Default: 'extension.crx')
48
- -e, --exclude Regular expression for filenames to exclude. (Default: \.crx$)
49
- -v, --version Extensionator version info.
50
- -h, --help Print this message.
49
+ -d, --directory Directory containing the extension. (Default: .)
50
+ -i, --identity Location of the pem file to sign with.
51
+ -o, --output Location of the output file. (Default: 'extension.[zip|crx]')
52
+ -e, --exclude Regular expression for filenames to exclude. (Default: .crx$)
53
+ -f, --format Type of file to produce, either zip or crx. Defaults to crx
54
+ --inject-version Inject a version number into the manifest file.
55
+ --inject-key Inject a key parameter into the manifest file.
56
+ -v, --version Extensionator version info.
57
+ -h, --help Print this message.
51
58
  ```
52
59
 
53
60
  ## Programmatically
@@ -56,13 +63,21 @@ Same as above, but:
56
63
 
57
64
  ```rb
58
65
  require "extensionator"
59
- Extensionator.create("directory/with/extension", "key.pem", "output_file.crx")
66
+ Extensionator.crx("directory/with/extension", "key.pem", "output_file.crx")
67
+ ```
68
+
69
+ Or to create a zip:
70
+
71
+ ```rb
72
+ Extensionator.zip("directory/with/extension", "output_file.zip")
60
73
  ```
61
74
 
62
- Or with an `exclude` option:
75
+ Options go at the end of either method call, and just look just like the CLI ones, but as Ruby symbols:
63
76
 
64
77
  ```rb
65
- Extensionator.create("dir", "key.pem", "output_file.crx", exclude: /\.md$/)
78
+ Extensionator.crx("dir", "key", "output.crx", inject_version: "4.5.1",
79
+ inject_key: true,
80
+ exclude: /\.md$/)
66
81
  ```
67
82
 
68
83
  ## License
@@ -9,9 +9,9 @@ module Extensionator
9
9
  o.string "-i", "--identity", "Location of the pem file to sign with."
10
10
  o.string "-o", "--output", "Location of the output file. (Default: 'extension.[zip|crx]')"
11
11
  o.string "-e", "--exclude", "Regular expression for filenames to exclude. (Default: \.crx$)"
12
- o.string "-f", "--format", "Type of file to produce, either zip or crx. Defaults to crx"
13
- o.string "--inject-version", "Inject a version number into the manifest file."
14
- o.bool "--inject-key", "Inject a key parameter into the manifest file."
12
+ o.string "-f", "--format", "Type of file to produce, either zip or crx. (Default: crx)"
13
+ o.string "--inject-version", "Inject a version number into the manifest file. (Default: none)"
14
+ o.bool "--inject-key", "Inject a key parameter into the manifest file. (Default: no)"
15
15
  #o.string "--skip-validation", "Don't try to validate this extension."
16
16
  o.on "-v", "--version", "Extensionator version info." do
17
17
  puts Extensionator::VERSION
@@ -1,3 +1,3 @@
1
1
  module Extensionator
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extensionator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Cambron