development 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +33 -8
- metadata +6 -14
data/README.md
CHANGED
@@ -4,13 +4,11 @@ http://rubygems.org/gems/development
|
|
4
4
|
|
5
5
|
# Summary #
|
6
6
|
|
7
|
-
|
7
|
+
Cause gem require to load a path other than the RubyGems installation.
|
8
8
|
|
9
9
|
# Description #
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
Development inserts itself in the require process and loads development paths instead of the gem requires used for production code. Which gems load development paths instead of gem requires is determined by a simple configuration file.
|
11
|
+
Intercept gem-require expression (require 'gem') and require version at alternative path (such as a development version).
|
14
12
|
|
15
13
|
# Install #
|
16
14
|
|
@@ -37,22 +35,26 @@ end
|
|
37
35
|
|
38
36
|
Doing this rather than simply requiring development ensures that Development can work transparently without requiring even a development dependency.
|
39
37
|
|
40
|
-
## 2. Configure Gems Development Should
|
38
|
+
## 2. Configure Which Gems Development Should Override ##
|
41
39
|
|
42
|
-
The primary interface to development is the **.development** configuration file, which should be placed in the user's home directory.
|
40
|
+
The primary interface to development is the **.development.rb** configuration file, which should be placed in the user's home directory.
|
43
41
|
|
44
|
-
I would make project-specific .development files a requirement (to avoid accidentally enabling it) but I don't think there is a reliable way to find the project directory based on the require. If you know a way, please let me know!
|
42
|
+
I would make project-specific .development.rb files a requirement (to avoid accidentally enabling it) but I don't think there is a reliable way to find the project directory based on the require. If you know a way, please let me know!
|
45
43
|
|
46
|
-
### Configuration File
|
44
|
+
### The .development.rb Configuration File ###
|
47
45
|
|
48
46
|
#### Short Example ####
|
49
47
|
|
48
|
+
The shortest possible example is a one-liner:
|
49
|
+
|
50
50
|
```ruby
|
51
51
|
enable! :parallel_ancestry => '~/Projects/rp/ruby/parallel_ancestry'
|
52
52
|
```
|
53
53
|
|
54
54
|
#### Extended Example ####
|
55
55
|
|
56
|
+
But other configuration possibilities are provided for more complex configurations:
|
57
|
+
|
56
58
|
```ruby
|
57
59
|
###
|
58
60
|
# Declare named locations to associate gems or gemsets with specific locations.
|
@@ -105,6 +107,29 @@ gem( 'to_lambda' ).directory( :ruby )
|
|
105
107
|
enable! :ruby, :hooked_objects, :compositing_objects, :parallel_ancestry
|
106
108
|
```
|
107
109
|
|
110
|
+
## Using Development with Bundler ##
|
111
|
+
|
112
|
+
Development plays well with bundler. The only caveat is that you have to require Development before Bundler.require:
|
113
|
+
|
114
|
+
```ruby
|
115
|
+
require 'bundler'
|
116
|
+
|
117
|
+
begin ; require 'development' ; rescue LoadError ; end
|
118
|
+
|
119
|
+
Bundler.require
|
120
|
+
```
|
121
|
+
|
122
|
+
or
|
123
|
+
|
124
|
+
```ruby
|
125
|
+
begin ; require 'development' ; rescue LoadError ; end
|
126
|
+
|
127
|
+
require 'bundler'
|
128
|
+
|
129
|
+
Bundler.require
|
130
|
+
```
|
131
|
+
|
132
|
+
|
108
133
|
# License #
|
109
134
|
|
110
135
|
(The MIT License)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: development
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,18 +9,10 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-15 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
|
-
description:
|
15
|
-
|
16
|
-
problem case without diving into the code. When gems are nested in multiple levels
|
17
|
-
of dependency, this can become quite frustrating; gem require paths have to be replaced
|
18
|
-
with relative paths, sometimes in multiple places, and it becomes easy to forget
|
19
|
-
that there are relative paths in code, resulting in production code with broken
|
20
|
-
development paths accidentally left in. Development inserts itself in the require
|
21
|
-
process and loads development paths instead of the gem requires used for production
|
22
|
-
code. Which gems load development paths instead of gem requires is determined by
|
23
|
-
a simple configuration file.
|
14
|
+
description: Intercept gem-require expression (require 'gem') and require version
|
15
|
+
at alternative path (such as a development version).
|
24
16
|
email: asher@ridiculouspower.com
|
25
17
|
executables: []
|
26
18
|
extensions: []
|
@@ -72,7 +64,7 @@ rubyforge_project: development
|
|
72
64
|
rubygems_version: 1.8.23
|
73
65
|
signing_key:
|
74
66
|
specification_version: 3
|
75
|
-
summary:
|
76
|
-
|
67
|
+
summary: Cause gem require (require 'gem') to load a path other than the RubyGems
|
68
|
+
installation.
|
77
69
|
test_files: []
|
78
70
|
has_rdoc:
|