mrubyを超漢字で動作させる
修訂 | 98285e6b16ec43ce921e779478eddbb2060cd33f (tree) |
---|---|
時間 | 2015-11-16 11:43:56 |
作者 | Zachary Scott <e@zzak...> |
Commiter | Zachary Scott |
This patch changes git gem behavior to never pull gems unless specified.
Since mgem's function almost the same as git gems, but you can see they already
avoid pulling from source after the gem has already been cloned.
mruby_build_gem.rake, or extracted here:
ruby
if File.exist? mgem_list_dir
else
end
Also, later in this same method; mgem will set the git params.
Doing this will trigger the following block:
ruby
if File.exist?(gemdir)
else
end
You can see here, this checks if $pull_gems is enabled before pulling.
Lastly, the final condition for this method is here:
ruby
if params[:checksum_hash]
else
end
What we changed was the else condition of this block to follow the same
behavior as the aforementioned code. In doing so, we can avoid two things:
* Excess clone calls can slow down builds (times number of gems used)
* We _don't_ want our code to _update_ during build
To explain, if during build time there are some changes in the gem we are
depending upon: updating during compile time could actually break our
application.
This is what we're trying to avoid.
@@ -106,7 +106,7 @@ module MRuby | ||
106 | 106 | git.run_checkout gemdir, params[:checksum_hash] |
107 | 107 | else |
108 | 108 | # Jump to the top of the branch |
109 | - git.run_checkout gemdir, branch | |
109 | + git.run_checkout gemdir, branch if $pull_gems | |
110 | 110 | end |
111 | 111 | else |
112 | 112 | fail "unknown gem option #{params}" |