gem-dependencies 0.3.0.rc1 → 0.3.0

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: ae07b23b2801b2e63733fa1a73f82299a6af6e21
4
- data.tar.gz: 4a702611f1812fdd358d6125eac64db223dcb0a4
3
+ metadata.gz: 48e537e935fc53d692b9201da1dc041e24f507b7
4
+ data.tar.gz: 64aba8b026e76a42d3f48f178e2d4a03d29fd7d6
5
5
  SHA512:
6
- metadata.gz: f2baad6f32b9ccbe869adc28d73dd8bf28a959c290bc96017eb589884446c8840df51d0e78fc6cf08c3411a2db7111bb3bbd93977ce89d069bdfb560fb70cffe
7
- data.tar.gz: 0d36fe6bd2ce0373d246b2808ed536171fc2ab2fe45d68736f4dda0ecbbe5dd77377a37dfea0defa25c52e4d9b487da9832a63e7e9fb231b1f1eaa365dcf3c65
6
+ metadata.gz: d62549925836ce0b67f80d577fd417d387a0a393ea0ac495e2130967254154741927eb1fbfa3683f13d3fa87582b8cf60fd2df620afe341eff261a5266040c1f
7
+ data.tar.gz: a62a407d896e691909fbdadc5dd8a9786b298bd6280c06233128ceb6cd5eb0089dfa65715b1f44ab11761998115b259f708f622a3756760fd10ca243eecfae77
@@ -1,4 +1 @@
1
- zc��
2
- d�@�Qe-�֫�6ur����S����W���ߋ�x�GB��D��p������m��5�Ն�'<����jC%�ķ���ۆ'E�@���8y�Z=� �ng
3
- ��ܦ+���K�U�͡���ޣ}u������5o�ā�2�J�W�^��
4
- ~_�Wi��ɸ�8la�� 5i{�s��� O(�%E��9����� ��t��t�|a�c���sW��0R �ғ�1�#l��Ϗ��C"�6����V�%�
1
+ ��DD�(��u�
data.tar.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -2,15 +2,17 @@
2
2
 
3
3
  A RubyGems plugin that simplifies working with gems that have binary extensions. It does this through the use of a succinct dependency index file. For development systems, this file specifies build dependencies and arguments necessary to compile and create a tarball with a gem's binary extensions. For runtime systems, which are lightweight and might not have access to a compiler, the dependency index file provides a list of runtime dependencies that must first be installed and also specifies the tarball which contains the pre-built binary extension files.
4
4
 
5
- Think of ```gem-dependencies``` as a helper that allows lightweight machines, such as docker containers, to be able to use native rubygems without having a compiler installed. At the moment that ```gem install``` would normally try to compile a binary extension, ```gem-dependencies``` will lookup the gem in it's dependency index and, if a matching version is found, install any required runtime packages and then download and extract any pre-compiled binary extensions. Everything works seamlessly and efficiently.
5
+ ## TL;DR
6
+
7
+ Think of ```gem-dependencies``` as a helper that allows lightweight systems, such as docker containers, to be able to use native rubygems without having a compiler installed. At the moment that ```gem install``` would normally try to compile a binary extension, ```gem-dependencies``` will lookup the gem in it's dependency index and, if a matching version is found, install any required runtime packages and then download and extract any pre-compiled binary extensions. Everything works seamlessly and efficiently.
6
8
 
7
9
  ## Usage
8
10
 
9
- You don't need to do anything special, just use ```gem install``` as normal. The resulting behavior is controlled by the value of the ```GEM_DEPENDENCIES``` environment variable. If this environment variable is not set, then this gem has no effect and is simply ignored.
11
+ You don't need to do anything special, just use ```gem install``` as normal. The resulting behavior is controlled by the value of the ```GEM_DEPENDENCIES``` environment variable. If this environment variable is not set, then this gem has no effect and is simply ignored. If ```GEM_DEPENDENCIES``` is set to a file system path or an http, https, git, or s3 url, then this value will be used to fetch the dependency index. As an additional help, all urls that begin with ```https://github.com/``` will be automatically suffixed with ```?raw=true```.
10
12
 
11
13
  ## Dependency index
12
14
 
13
- The dependency index is a YAML file that contains information necessary to compile gems on a development system or install them on a runtime system. An example dependency file looks like:
15
+ The dependency index is a YAML file that contains information necessary to compile gems on a development system or install them on a runtime system. A dependency index file looks like this:
14
16
 
15
17
  ```yaml
16
18
  gems:
@@ -18,13 +20,13 @@ gems:
18
20
  command: apk --update add ${packages}
19
21
  bcrypt:
20
22
  mysql2: "* mariadb-libs"
21
- nokogiri: "* libxml2 libxslt +libxml2-dev +libxslt -- --use-system-libraries"
23
+ nokogiri: "* libxml2 libxslt +libxml2-dev +libxslt-dev -- --use-system-libraries"
22
24
  pokogiri:
23
25
  - "*"
24
26
  - libxml2
25
27
  - libxslt
26
28
  - +libxml2-dev
27
- - +libxslt
29
+ - +libxslt-dev
28
30
  - --
29
31
  - --use-system-libraries
30
32
  unf_ext:
@@ -33,47 +35,68 @@ gems:
33
35
  "< 0.0.4": "s3://foo:bar@s3.amazon.com/baz/* one two three"
34
36
  ```
35
37
 
36
- The format of this file is quite flexible. Keys in the above hash represent gems that have binary extensions. The hash values can be:
37
-
38
- * ```nil``` (like ```bcrypt``` above)
39
- * ```String``` (like ```mysql``` above)
40
- * ```Array``` (like ```pokogiri``` above)
41
- * ```Hash``` (like ```unf_ext``` above)
42
-
38
+ The format of this file is quite flexible. Keys in the above hash represent gems that have binary extensions. The hash values can be ```nil``` (see ```bcrypt```), a ```String``` (see ```mysql2```), an ```Array``` (see ```pokogiri```), or a version-indexed ```Hash``` (see ```enf_ext```). Shortcuts are defined for each space-delimited ```String``` or ```Array``` element such that:
43
39
 
40
+ * a ```nil``` or ```*``` is a sibling file to the dependency index, named ```${gemname}-${version}.tar.gz```
41
+ * a leading ```*``` will be replaced with the base directory of the dependency index
42
+ * a subsequent ```*``` will be replaced with ```${gemname}-${version}.tar.gz```
43
+ * a leading ```+``` indicates a development dependency
44
+ * a leading ```-``` indicates a build-time argument to the ```gem``` command
45
+ * a value containing ```.tar.gz``` indicates a binary extensions tarball
44
46
 
45
- After determining the runtime dependencies and creating a compiled extensions tarball, edit the dependency index to add a key with the name of the new gem and sub-keys to indicate the version requirements. The values of these sub-key are either an array of package dependencies and extension tarballs or a space-delimited string of the same. All items ending in ```.tar.gz``` are considered to be extension tarballs and everything else is considered to be a package dependency. Extension tarballs can also be given as a file system path or an http, https, git, or s3 url. As an additional help, all urls that begin with ```https://github.com/``` will be automatically suffixed with ```?raw=true```.
47
+ Wildcards can be combined such as ```unf_ext``` where the values for one version range includes ```*/old-gems/*```. In this example, this gives ```https://github.com/shreeve/gemdeps-alpine-3.2-x86_64-2.2.0/blob/master/old-gems/unf_ext-0.0.6.tar.gz```. These shortcuts are much easier to type and they will dynamically use the proper gem versions.
46
48
 
47
- There are several naming shortcuts that can be used for extension tarballs. In the common case, when there is one tarball with binary extensions for a gem and no package dependencies, you can simply leave the hash value empty (as shown in the case of ```bcrypt``` above). This will cause ```gem-dependencies``` to download and extract a file named ```bcrypt-3.1.10.tar.gz``` (or whatever gem name and version you are installing) from the base path of the ```GEM_DEPENDENCIES``` environment variable. If, as in the case of ```mysql2``` above, you do have some platform dependencies, then use the ```*``` to indicate the 'default' extension tarball and then list the package dependencies. If a ```*``` character is found anywhere else, it will be interpreted as the value ```{gemname}-{version}.tar.gz```. You can combine wildcards such as the case of ```nokogiri``` above, where ```*/old-gems/*``` will give ```https://github.com/shreeve/gemdeps-alpine-3.2-x86_64-2.2.0/blob/master/old-gems/nokogiri-1.4.4.tar.gz```. These shortcuts are much easier to type and they will dynamically use the proper gem versions.
49
+ ## Development system
48
50
 
51
+ Make sure your development system has the same architecture as your runtime system. Development systems are indicated by a leading ```+``` in the value of the ```GEM_DEPENDENCIES``` environment variable. Suppose the following variable is set:
49
52
 
53
+ ```shell
54
+ export GEM_DEPENDENCIES="+https://github.com/shreeve/gemdeps-alpine-3.2-x86_64-2.2.0/blob/master/INDEX.yaml"
55
+ ```
50
56
 
57
+ Then, this command:
51
58
 
52
- ## Development system
59
+ ```shell
60
+ gem install nokogiri
61
+ ```
53
62
 
54
- Make sure you have a development system with the same architecture as your runtime system. On the development system, make a note of all of the package dependencies needed to install the desired gem. Finally, run:
63
+ will lookup the dependency index, finding:
55
64
 
56
- ```shell
57
- $ GEM_DEPENDENCIES=1 gem install bcrypt
65
+ ```yaml
66
+ nokogiri: "* libxml2 libxslt +libxml2-dev +libxslt-dev -- --use-system-libraries"
58
67
  ```
59
68
 
60
- This will perform a normal install, but it will also create a tarball in the current directory with the compiled extensions for the given gem. The naming scheme is straightforward and based on the gem's name and version (e.g. ```bcrypt-3.1.10.tar.gz```).
69
+ which will:
70
+
71
+ * Install the ```libxml2-dev``` and ```libxslt-dev``` packages (these start with ```+```)
72
+ * Execute ```gem install nokogiri -- --use-system-libraries``` (these start with ```-```)
73
+ * Create a binary extensions tarball (e.g. ```nokogiri-1.6.6.2.tar.gz```) in the current directory
61
74
 
62
75
  ## Runtime system
63
76
 
64
- If ```GEM_DEPENDENCIES``` is set to a file system path or an http, https, git, or s3 url, then this value will be used to fetch the dependency index. Suppose the following command is run from the runtime system:
77
+ Suppose the following variable is set (without the leading ```+``` character):
65
78
 
66
79
  ```shell
67
80
  export GEM_DEPENDENCIES="https://github.com/shreeve/gemdeps-alpine-3.2-x86_64-2.2.0/blob/master/INDEX.yaml"
68
- gem install bcrypt
69
81
  ```
70
82
 
71
- The dependency index will be downloaded and searched for the requested gem and version. If a match is found, then the order of installation is as follows:
83
+ Then, this command:
84
+
85
+ ```shell
86
+ gem install nokogiri
87
+ ```
88
+
89
+ will lookup the dependency index, finding:
90
+
91
+ ```yaml
92
+ nokogiri: "* libxml2 libxslt +libxml2-dev +libxslt-dev -- --use-system-libraries"
93
+ ```
94
+
95
+ which will:
72
96
 
73
- * package dependencies will be installed (uses the value from the ```command``` key),
74
- * the 'normal' gem files will be installed
75
- * the 'normal' build_extensions step will be skipped, and
76
- * compiled extension tarballs will be downloaded and installed
97
+ * Install the ```libxml2``` and ```libxslt``` packages
98
+ * Execute ```gem install nokogiri```, but will skip the ```build_extensions``` step
99
+ * Download and extract the default extensions tarball at ```https://github.com/shreeve/gemdeps-alpine-3.2-x86_64-2.2.0/blob/master/nokogiri-1.6.6.2.tar.gz```
77
100
 
78
101
  Note that a version requirement can also be specified in the ```gem install``` command. For example, the following are all valid:
79
102
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "gem-dependencies"
5
- s.version = "0.3.0.rc1"
5
+ s.version = "0.3.0"
6
6
  s.summary = "RubyGems plugin to simplify installing binary gems on runtime systems."
7
7
  s.description = "This gem makes it easy to install binary gems on systems without a compiler."
8
8
  s.homepage = "https://github.com/shreeve/gem-dependencies"
@@ -61,7 +61,8 @@ module Gem
61
61
  reqs, deps = deps.find do |reqs, info| # deps is an array or space-delimited string
62
62
  Gem::Requirement.new(reqs.split(',')).satisfied_by?(spec.version)
63
63
  end
64
- deps or return #!# what about nil here? should it be the same as non-hash version?
64
+ reqs or return # can't find the right version
65
+ deps ||= ["*"] # deps are nil, use the default extension name
65
66
  end
66
67
  deps = deps.strip.split(/\s+/) if deps.is_a?(String)
67
68
  deps = deps.compact.uniq
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-dependencies
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.rc1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve
@@ -59,9 +59,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
59
59
  version: '0'
60
60
  required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - ">"
62
+ - - ">="
63
63
  - !ruby/object:Gem::Version
64
- version: 1.3.1
64
+ version: '0'
65
65
  requirements: []
66
66
  rubyforge_project:
67
67
  rubygems_version: 2.4.7
metadata.gz.sig CHANGED
Binary file