ecogem 0.0.4 → 0.0.5

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: d7904ba539f80c558e94a230fba0c11577aa531f
4
- data.tar.gz: a3014fc9609014738ae0a090232c202ed09b70ba
3
+ metadata.gz: dde01569da57740cc428ec27076bf5aeb8f87e28
4
+ data.tar.gz: 52ec03ce86fb0c0c19f078720d0ad5fe2324ae3c
5
5
  SHA512:
6
- metadata.gz: c4d7e7a2d73218b41f6e8dd471cabd60c71cd42552e5e713e6a190f01ab37de2f9c03527f81778931ee76c687b320fc7eb4f5815ce59d0d93edc256bdd493dec
7
- data.tar.gz: a5ebb52222cd9b17cb5a44a85a369de808264031f67047b791366026e53f4231cbd8675deed643f5a6e260dd2bdbe1c016ab1a4232a91087674f3e4d4c782088
6
+ metadata.gz: 5835ff92f8b18f1e44406c0855ffd771c171551cd52f8ed081a0fc9ca7047474427bff66aa6b29770a710965a5b484310a1c2d0d94ec6c4c0ec8d434c2986e53
7
+ data.tar.gz: b03ec18354de43495fd83eea7b361a1f44b3e38d18c8f4d3121b05723dd4a093ba40f6f73de606b8c5714df17b209fbbee2ce463eae2844b35d2bb7459b12778
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ecogem
2
2
 
3
- Supplements Bundler for installing private gems.
3
+ Supplements Bundler for installing private gems. https://rubygems.org/gems/ecogem
4
4
 
5
5
  ## Preface
6
6
 
@@ -102,7 +102,7 @@ Then `ecogem install` will:
102
102
  gem 'rake' # from rubygems.org
103
103
  ```
104
104
 
105
- 1. fetch gem-a's Ecogemfile
105
+ 1. fetch the gem-a repo and parse gem-a's Ecogemfile
106
106
 
107
107
  gem-a's Ecogemfile:
108
108
 
@@ -112,7 +112,7 @@ Then `ecogem install` will:
112
112
  gemspec
113
113
  ```
114
114
 
115
- 1. fetch gem-b's Ecogemfile
115
+ 1. fetch the gem-b repo and parse gem-b's Ecogemfile
116
116
 
117
117
  gem-b's Ecogemfile:
118
118
 
@@ -130,13 +130,34 @@ Then `ecogem install` will:
130
130
 
131
131
  source "https://rubygems.org/"
132
132
 
133
- gem 'gem-b', path: Ecogem.git_path("git@github.com:me/gem-b.git master")
134
- gem 'gem-a', path: Ecogem.git_path("git@github.com:me/gem-a.git master")
135
- gem 'rake'
133
+ gem "gem-b", path: Ecogem.git_path("git@github.com:me/gem-b.git master")
134
+ gem "gem-a", path: Ecogem.git_path("git@github.com:me/gem-a.git master")
135
+ gem "rake"
136
136
  ```
137
137
 
138
138
  1. and finally execute `bundle install` with the new Gemfile
139
139
 
140
+ ## Configuration File
141
+
142
+ Ecogem reads your configuration file and configures its runtime environment.
143
+
144
+ The location of file is `~/.ecogem/config`. ~ is the current user's home directory.
145
+
146
+ ## Multiple SSH Keys for Fetching Repositories
147
+
148
+ Ecogem supports multiple SSH keys for fetching repositories, described at [this gist](https://gist.github.com/jexchan/2351996
149
+ ).
150
+
151
+ Write your uri aliases in your config like:
152
+
153
+ ```yaml
154
+ git_sources:
155
+ - uri: git@github.com:username/my.git
156
+ uri_alias: git@github.com-username:username/my.git
157
+ ```
158
+
159
+ Then Ecogem converts the uri to the uri_alias.
160
+
140
161
  ## Contributing
141
162
 
142
163
  1. Fork it ( https://github.com/moso2p/ecogem/fork )
@@ -19,7 +19,6 @@ module Ecogem
19
19
  def self.new_workspace(args, options = {}, &block)
20
20
  Workspace.new(args, options) do |ws|
21
21
  begin
22
- ::Thread.current[:ecogem_workspaces] ||= []
23
22
  workspaces << ws
24
23
  break block.call(ws)
25
24
  ensure
@@ -44,6 +44,31 @@ module Ecogem
44
44
  into
45
45
  end
46
46
 
47
+ private def extracted_dependencies_by_names
48
+ @extracted_dependencies_by_names ||= begin
49
+ h = {}
50
+ extracted_dependencies.each do |d|
51
+ h[d.name] ||= []
52
+ h[d.name] << d
53
+ end
54
+ h
55
+ end
56
+ end
57
+
58
+ private def exported_dependencies
59
+ @exported_dependencies ||= begin
60
+ a = []
61
+ extracted_dependencies.each do |d|
62
+ if d.source.git?
63
+ ds = extracted_dependencies_by_names[d.name]
64
+ next if ds.find{|i| i.source.path?}
65
+ end
66
+ a << d
67
+ end
68
+ a
69
+ end
70
+ end
71
+
47
72
  private def sources
48
73
  @sources ||= data.sources.instance_variable_get(:@rubygems_aggregate).remotes.map{|i| i.to_s}
49
74
  end
@@ -53,7 +78,7 @@ module Ecogem
53
78
  a = []
54
79
  a << 'require "ecogem"'
55
80
  a << sources.reverse.map{|i| "source #{i.inspect}"}.join("\n")
56
- a << extracted_dependencies.map{|i| i.code}.uniq.join("\n")
81
+ a << exported_dependencies.map{|i| i.code}.uniq.join("\n")
57
82
  a.join("\n\n")
58
83
  end
59
84
  end
@@ -85,7 +110,8 @@ module Ecogem
85
110
  pid = ::Process.fork do
86
111
  params = ::Marshal.load(in_r)
87
112
 
88
- ::Dir.chdir(::File.dirname(params[:path])) do
113
+ ::Dir.chdir(::File.dirname(params[:path])) do |dir|
114
+ ENV['BUNDLE_GEMFILE'] = params[:path]
89
115
  dsl = ::Bundler::Dsl.new
90
116
  dsl.eval_gemfile(params[:path])
91
117
  result = ::Ecogem::Gemfile::Marshal.new(dsl).to_data
@@ -1,3 +1,3 @@
1
1
  module Ecogem
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecogem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - mosop