bundler-maglev- 1.0.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. data/.gitignore +22 -0
  2. data/.travis.yml +32 -0
  3. data/CHANGELOG.md +805 -0
  4. data/ISSUES.md +62 -0
  5. data/LICENSE +23 -0
  6. data/README.md +29 -0
  7. data/Rakefile +212 -0
  8. data/UPGRADING.md +103 -0
  9. data/bin/bundle +22 -0
  10. data/bundler.gemspec +30 -0
  11. data/lib/bundler.rb +286 -0
  12. data/lib/bundler/capistrano.rb +11 -0
  13. data/lib/bundler/cli.rb +520 -0
  14. data/lib/bundler/definition.rb +438 -0
  15. data/lib/bundler/dependency.rb +134 -0
  16. data/lib/bundler/deployment.rb +58 -0
  17. data/lib/bundler/dsl.rb +257 -0
  18. data/lib/bundler/environment.rb +47 -0
  19. data/lib/bundler/gem_helper.rb +151 -0
  20. data/lib/bundler/gem_installer.rb +9 -0
  21. data/lib/bundler/gem_tasks.rb +2 -0
  22. data/lib/bundler/graph.rb +130 -0
  23. data/lib/bundler/index.rb +138 -0
  24. data/lib/bundler/installer.rb +97 -0
  25. data/lib/bundler/lazy_specification.rb +74 -0
  26. data/lib/bundler/lockfile_parser.rb +108 -0
  27. data/lib/bundler/remote_specification.rb +59 -0
  28. data/lib/bundler/resolver.rb +464 -0
  29. data/lib/bundler/rubygems_ext.rb +237 -0
  30. data/lib/bundler/rubygems_integration.rb +349 -0
  31. data/lib/bundler/runtime.rb +152 -0
  32. data/lib/bundler/settings.rb +115 -0
  33. data/lib/bundler/setup.rb +23 -0
  34. data/lib/bundler/shared_helpers.rb +71 -0
  35. data/lib/bundler/source.rb +708 -0
  36. data/lib/bundler/spec_set.rb +135 -0
  37. data/lib/bundler/templates/Executable +16 -0
  38. data/lib/bundler/templates/Gemfile +4 -0
  39. data/lib/bundler/templates/newgem/Gemfile.tt +4 -0
  40. data/lib/bundler/templates/newgem/Rakefile.tt +1 -0
  41. data/lib/bundler/templates/newgem/bin/newgem.tt +3 -0
  42. data/lib/bundler/templates/newgem/gitignore.tt +4 -0
  43. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +9 -0
  44. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
  45. data/lib/bundler/templates/newgem/newgem.gemspec.tt +24 -0
  46. data/lib/bundler/ui.rb +73 -0
  47. data/lib/bundler/vendor/thor.rb +358 -0
  48. data/lib/bundler/vendor/thor/actions.rb +314 -0
  49. data/lib/bundler/vendor/thor/actions/create_file.rb +105 -0
  50. data/lib/bundler/vendor/thor/actions/create_link.rb +57 -0
  51. data/lib/bundler/vendor/thor/actions/directory.rb +93 -0
  52. data/lib/bundler/vendor/thor/actions/empty_directory.rb +134 -0
  53. data/lib/bundler/vendor/thor/actions/file_manipulation.rb +270 -0
  54. data/lib/bundler/vendor/thor/actions/inject_into_file.rb +109 -0
  55. data/lib/bundler/vendor/thor/base.rb +576 -0
  56. data/lib/bundler/vendor/thor/core_ext/file_binary_read.rb +9 -0
  57. data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +75 -0
  58. data/lib/bundler/vendor/thor/core_ext/ordered_hash.rb +100 -0
  59. data/lib/bundler/vendor/thor/error.rb +30 -0
  60. data/lib/bundler/vendor/thor/group.rb +273 -0
  61. data/lib/bundler/vendor/thor/invocation.rb +168 -0
  62. data/lib/bundler/vendor/thor/parser.rb +4 -0
  63. data/lib/bundler/vendor/thor/parser/argument.rb +67 -0
  64. data/lib/bundler/vendor/thor/parser/arguments.rb +161 -0
  65. data/lib/bundler/vendor/thor/parser/option.rb +120 -0
  66. data/lib/bundler/vendor/thor/parser/options.rb +175 -0
  67. data/lib/bundler/vendor/thor/rake_compat.rb +66 -0
  68. data/lib/bundler/vendor/thor/runner.rb +309 -0
  69. data/lib/bundler/vendor/thor/shell.rb +88 -0
  70. data/lib/bundler/vendor/thor/shell/basic.rb +302 -0
  71. data/lib/bundler/vendor/thor/shell/color.rb +108 -0
  72. data/lib/bundler/vendor/thor/shell/html.rb +121 -0
  73. data/lib/bundler/vendor/thor/task.rb +113 -0
  74. data/lib/bundler/vendor/thor/util.rb +229 -0
  75. data/lib/bundler/vendor/thor/version.rb +3 -0
  76. data/lib/bundler/vendored_thor.rb +7 -0
  77. data/lib/bundler/version.rb +6 -0
  78. data/lib/bundler/vlad.rb +11 -0
  79. data/man/bundle-config.ronn +90 -0
  80. data/man/bundle-exec.ronn +111 -0
  81. data/man/bundle-install.ronn +317 -0
  82. data/man/bundle-package.ronn +59 -0
  83. data/man/bundle-update.ronn +176 -0
  84. data/man/bundle.ronn +80 -0
  85. data/man/gemfile.5.ronn +284 -0
  86. data/man/index.txt +6 -0
  87. data/spec/bundler/gem_helper_spec.rb +143 -0
  88. data/spec/cache/gems_spec.rb +230 -0
  89. data/spec/cache/git_spec.rb +12 -0
  90. data/spec/cache/path_spec.rb +27 -0
  91. data/spec/cache/platform_spec.rb +57 -0
  92. data/spec/install/deploy_spec.rb +197 -0
  93. data/spec/install/deprecated_spec.rb +37 -0
  94. data/spec/install/gems/c_ext_spec.rb +48 -0
  95. data/spec/install/gems/env_spec.rb +107 -0
  96. data/spec/install/gems/flex_spec.rb +313 -0
  97. data/spec/install/gems/groups_spec.rb +259 -0
  98. data/spec/install/gems/packed_spec.rb +84 -0
  99. data/spec/install/gems/platform_spec.rb +192 -0
  100. data/spec/install/gems/resolving_spec.rb +72 -0
  101. data/spec/install/gems/simple_case_spec.rb +770 -0
  102. data/spec/install/gems/sudo_spec.rb +74 -0
  103. data/spec/install/gems/win32_spec.rb +26 -0
  104. data/spec/install/gemspec_spec.rb +125 -0
  105. data/spec/install/git_spec.rb +570 -0
  106. data/spec/install/invalid_spec.rb +35 -0
  107. data/spec/install/path_spec.rb +405 -0
  108. data/spec/install/upgrade_spec.rb +26 -0
  109. data/spec/lock/git_spec.rb +35 -0
  110. data/spec/lock/lockfile_spec.rb +739 -0
  111. data/spec/other/check_spec.rb +221 -0
  112. data/spec/other/config_spec.rb +40 -0
  113. data/spec/other/console_spec.rb +54 -0
  114. data/spec/other/exec_spec.rb +248 -0
  115. data/spec/other/ext_spec.rb +37 -0
  116. data/spec/other/help_spec.rb +39 -0
  117. data/spec/other/init_spec.rb +40 -0
  118. data/spec/other/newgem_spec.rb +46 -0
  119. data/spec/other/open_spec.rb +35 -0
  120. data/spec/other/show_spec.rb +82 -0
  121. data/spec/quality_spec.rb +62 -0
  122. data/spec/resolver/basic_spec.rb +20 -0
  123. data/spec/resolver/platform_spec.rb +82 -0
  124. data/spec/runtime/executable_spec.rb +110 -0
  125. data/spec/runtime/load_spec.rb +107 -0
  126. data/spec/runtime/platform_spec.rb +90 -0
  127. data/spec/runtime/require_spec.rb +231 -0
  128. data/spec/runtime/setup_spec.rb +730 -0
  129. data/spec/runtime/with_clean_env_spec.rb +15 -0
  130. data/spec/spec_helper.rb +92 -0
  131. data/spec/support/builders.rb +597 -0
  132. data/spec/support/helpers.rb +239 -0
  133. data/spec/support/indexes.rb +112 -0
  134. data/spec/support/matchers.rb +77 -0
  135. data/spec/support/path.rb +71 -0
  136. data/spec/support/platforms.rb +53 -0
  137. data/spec/support/ruby_ext.rb +20 -0
  138. data/spec/support/rubygems_ext.rb +37 -0
  139. data/spec/support/rubygems_hax/platform.rb +11 -0
  140. data/spec/support/sudo.rb +21 -0
  141. data/spec/update/gems_spec.rb +122 -0
  142. data/spec/update/git_spec.rb +196 -0
  143. data/spec/update/source_spec.rb +51 -0
  144. metadata +296 -0
@@ -0,0 +1,314 @@
1
+ require 'fileutils'
2
+ require 'uri'
3
+ require 'thor/core_ext/file_binary_read'
4
+ require 'thor/actions/create_file'
5
+ require 'thor/actions/create_link'
6
+ require 'thor/actions/directory'
7
+ require 'thor/actions/empty_directory'
8
+ require 'thor/actions/file_manipulation'
9
+ require 'thor/actions/inject_into_file'
10
+
11
+ class Thor
12
+ module Actions
13
+ attr_accessor :behavior
14
+
15
+ def self.included(base) #:nodoc:
16
+ base.extend ClassMethods
17
+ end
18
+
19
+ module ClassMethods
20
+ # Hold source paths for one Thor instance. source_paths_for_search is the
21
+ # method responsible to gather source_paths from this current class,
22
+ # inherited paths and the source root.
23
+ #
24
+ def source_paths
25
+ @_source_paths ||= []
26
+ end
27
+
28
+ # Stores and return the source root for this class
29
+ def source_root(path=nil)
30
+ @_source_root = path if path
31
+ @_source_root
32
+ end
33
+
34
+ # Returns the source paths in the following order:
35
+ #
36
+ # 1) This class source paths
37
+ # 2) Source root
38
+ # 3) Parents source paths
39
+ #
40
+ def source_paths_for_search
41
+ paths = []
42
+ paths += self.source_paths
43
+ paths << self.source_root if self.source_root
44
+ paths += from_superclass(:source_paths, [])
45
+ paths
46
+ end
47
+
48
+ # Add runtime options that help actions execution.
49
+ #
50
+ def add_runtime_options!
51
+ class_option :force, :type => :boolean, :aliases => "-f", :group => :runtime,
52
+ :desc => "Overwrite files that already exist"
53
+
54
+ class_option :pretend, :type => :boolean, :aliases => "-p", :group => :runtime,
55
+ :desc => "Run but do not make any changes"
56
+
57
+ class_option :quiet, :type => :boolean, :aliases => "-q", :group => :runtime,
58
+ :desc => "Supress status output"
59
+
60
+ class_option :skip, :type => :boolean, :aliases => "-s", :group => :runtime,
61
+ :desc => "Skip files that already exist"
62
+ end
63
+ end
64
+
65
+ # Extends initializer to add more configuration options.
66
+ #
67
+ # ==== Configuration
68
+ # behavior<Symbol>:: The actions default behavior. Can be :invoke or :revoke.
69
+ # It also accepts :force, :skip and :pretend to set the behavior
70
+ # and the respective option.
71
+ #
72
+ # destination_root<String>:: The root directory needed for some actions.
73
+ #
74
+ def initialize(args=[], options={}, config={})
75
+ self.behavior = case config[:behavior].to_s
76
+ when "force", "skip"
77
+ _cleanup_options_and_set(options, config[:behavior])
78
+ :invoke
79
+ when "revoke"
80
+ :revoke
81
+ else
82
+ :invoke
83
+ end
84
+
85
+ super
86
+ self.destination_root = config[:destination_root]
87
+ end
88
+
89
+ # Wraps an action object and call it accordingly to the thor class behavior.
90
+ #
91
+ def action(instance) #:nodoc:
92
+ if behavior == :revoke
93
+ instance.revoke!
94
+ else
95
+ instance.invoke!
96
+ end
97
+ end
98
+
99
+ # Returns the root for this thor class (also aliased as destination root).
100
+ #
101
+ def destination_root
102
+ @destination_stack.last
103
+ end
104
+
105
+ # Sets the root for this thor class. Relatives path are added to the
106
+ # directory where the script was invoked and expanded.
107
+ #
108
+ def destination_root=(root)
109
+ @destination_stack ||= []
110
+ @destination_stack[0] = File.expand_path(root || '')
111
+ end
112
+
113
+ # Returns the given path relative to the absolute root (ie, root where
114
+ # the script started).
115
+ #
116
+ def relative_to_original_destination_root(path, remove_dot=true)
117
+ path = path.gsub(@destination_stack[0], '.')
118
+ remove_dot ? (path[2..-1] || '') : path
119
+ end
120
+
121
+ # Holds source paths in instance so they can be manipulated.
122
+ #
123
+ def source_paths
124
+ @source_paths ||= self.class.source_paths_for_search
125
+ end
126
+
127
+ # Receives a file or directory and search for it in the source paths.
128
+ #
129
+ def find_in_source_paths(file)
130
+ relative_root = relative_to_original_destination_root(destination_root, false)
131
+
132
+ source_paths.each do |source|
133
+ source_file = File.expand_path(file, File.join(source, relative_root))
134
+ return source_file if File.exists?(source_file)
135
+ end
136
+
137
+ message = "Could not find #{file.inspect} in any of your source paths. "
138
+
139
+ unless self.class.source_root
140
+ message << "Please invoke #{self.class.name}.source_root(PATH) with the PATH containing your templates. "
141
+ end
142
+
143
+ if source_paths.empty?
144
+ message << "Currently you have no source paths."
145
+ else
146
+ message << "Your current source paths are: \n#{source_paths.join("\n")}"
147
+ end
148
+
149
+ raise Error, message
150
+ end
151
+
152
+ # Do something in the root or on a provided subfolder. If a relative path
153
+ # is given it's referenced from the current root. The full path is yielded
154
+ # to the block you provide. The path is set back to the previous path when
155
+ # the method exits.
156
+ #
157
+ # ==== Parameters
158
+ # dir<String>:: the directory to move to.
159
+ # config<Hash>:: give :verbose => true to log and use padding.
160
+ #
161
+ def inside(dir='', config={}, &block)
162
+ verbose = config.fetch(:verbose, false)
163
+ pretend = options[:pretend]
164
+
165
+ say_status :inside, dir, verbose
166
+ shell.padding += 1 if verbose
167
+ @destination_stack.push File.expand_path(dir, destination_root)
168
+
169
+ # If the directory doesnt exist and we're not pretending
170
+ if !File.exist?(destination_root) && !pretend
171
+ FileUtils.mkdir_p(destination_root)
172
+ end
173
+
174
+ if pretend
175
+ # In pretend mode, just yield down to the block
176
+ block.arity == 1 ? yield(destination_root) : yield
177
+ else
178
+ FileUtils.cd(destination_root) { block.arity == 1 ? yield(destination_root) : yield }
179
+ end
180
+
181
+ @destination_stack.pop
182
+ shell.padding -= 1 if verbose
183
+ end
184
+
185
+ # Goes to the root and execute the given block.
186
+ #
187
+ def in_root
188
+ inside(@destination_stack.first) { yield }
189
+ end
190
+
191
+ # Loads an external file and execute it in the instance binding.
192
+ #
193
+ # ==== Parameters
194
+ # path<String>:: The path to the file to execute. Can be a web address or
195
+ # a relative path from the source root.
196
+ #
197
+ # ==== Examples
198
+ #
199
+ # apply "http://gist.github.com/103208"
200
+ #
201
+ # apply "recipes/jquery.rb"
202
+ #
203
+ def apply(path, config={})
204
+ verbose = config.fetch(:verbose, true)
205
+ is_uri = path =~ /^https?\:\/\//
206
+ path = find_in_source_paths(path) unless is_uri
207
+
208
+ say_status :apply, path, verbose
209
+ shell.padding += 1 if verbose
210
+
211
+ if is_uri
212
+ contents = open(path, "Accept" => "application/x-thor-template") {|io| io.read }
213
+ else
214
+ contents = open(path) {|io| io.read }
215
+ end
216
+
217
+ instance_eval(contents, path)
218
+ shell.padding -= 1 if verbose
219
+ end
220
+
221
+ # Executes a command returning the contents of the command.
222
+ #
223
+ # ==== Parameters
224
+ # command<String>:: the command to be executed.
225
+ # config<Hash>:: give :verbose => false to not log the status, :capture => true to hide to output. Specify :with
226
+ # to append an executable to command executation.
227
+ #
228
+ # ==== Example
229
+ #
230
+ # inside('vendor') do
231
+ # run('ln -s ~/edge rails')
232
+ # end
233
+ #
234
+ def run(command, config={})
235
+ return unless behavior == :invoke
236
+
237
+ destination = relative_to_original_destination_root(destination_root, false)
238
+ desc = "#{command} from #{destination.inspect}"
239
+
240
+ if config[:with]
241
+ desc = "#{File.basename(config[:with].to_s)} #{desc}"
242
+ command = "#{config[:with]} #{command}"
243
+ end
244
+
245
+ say_status :run, desc, config.fetch(:verbose, true)
246
+
247
+ unless options[:pretend]
248
+ config[:capture] ? `#{command}` : system("#{command}")
249
+ end
250
+ end
251
+
252
+ # Executes a ruby script (taking into account WIN32 platform quirks).
253
+ #
254
+ # ==== Parameters
255
+ # command<String>:: the command to be executed.
256
+ # config<Hash>:: give :verbose => false to not log the status.
257
+ #
258
+ def run_ruby_script(command, config={})
259
+ return unless behavior == :invoke
260
+ run command, config.merge(:with => Thor::Util.ruby_command)
261
+ end
262
+
263
+ # Run a thor command. A hash of options can be given and it's converted to
264
+ # switches.
265
+ #
266
+ # ==== Parameters
267
+ # task<String>:: the task to be invoked
268
+ # args<Array>:: arguments to the task
269
+ # config<Hash>:: give :verbose => false to not log the status, :capture => true to hide to output.
270
+ # Other options are given as parameter to Thor.
271
+ #
272
+ #
273
+ # ==== Examples
274
+ #
275
+ # thor :install, "http://gist.github.com/103208"
276
+ # #=> thor install http://gist.github.com/103208
277
+ #
278
+ # thor :list, :all => true, :substring => 'rails'
279
+ # #=> thor list --all --substring=rails
280
+ #
281
+ def thor(task, *args)
282
+ config = args.last.is_a?(Hash) ? args.pop : {}
283
+ verbose = config.key?(:verbose) ? config.delete(:verbose) : true
284
+ pretend = config.key?(:pretend) ? config.delete(:pretend) : false
285
+ capture = config.key?(:capture) ? config.delete(:capture) : false
286
+
287
+ args.unshift task
288
+ args.push Thor::Options.to_switches(config)
289
+ command = args.join(' ').strip
290
+
291
+ run command, :with => :thor, :verbose => verbose, :pretend => pretend, :capture => capture
292
+ end
293
+
294
+ protected
295
+
296
+ # Allow current root to be shared between invocations.
297
+ #
298
+ def _shared_configuration #:nodoc:
299
+ super.merge!(:destination_root => self.destination_root)
300
+ end
301
+
302
+ def _cleanup_options_and_set(options, key) #:nodoc:
303
+ case options
304
+ when Array
305
+ %w(--force -f --skip -s).each { |i| options.delete(i) }
306
+ options << "--#{key}"
307
+ when Hash
308
+ [:force, :skip, "force", "skip"].each { |i| options.delete(i) }
309
+ options.merge!(key => true)
310
+ end
311
+ end
312
+
313
+ end
314
+ end
@@ -0,0 +1,105 @@
1
+ require 'thor/actions/empty_directory'
2
+
3
+ class Thor
4
+ module Actions
5
+
6
+ # Create a new file relative to the destination root with the given data,
7
+ # which is the return value of a block or a data string.
8
+ #
9
+ # ==== Parameters
10
+ # destination<String>:: the relative path to the destination root.
11
+ # data<String|NilClass>:: the data to append to the file.
12
+ # config<Hash>:: give :verbose => false to not log the status.
13
+ #
14
+ # ==== Examples
15
+ #
16
+ # create_file "lib/fun_party.rb" do
17
+ # hostname = ask("What is the virtual hostname I should use?")
18
+ # "vhost.name = #{hostname}"
19
+ # end
20
+ #
21
+ # create_file "config/apache.conf", "your apache config"
22
+ #
23
+ def create_file(destination, *args, &block)
24
+ config = args.last.is_a?(Hash) ? args.pop : {}
25
+ data = args.first
26
+ action CreateFile.new(self, destination, block || data.to_s, config)
27
+ end
28
+ alias :add_file :create_file
29
+
30
+ # CreateFile is a subset of Template, which instead of rendering a file with
31
+ # ERB, it gets the content from the user.
32
+ #
33
+ class CreateFile < EmptyDirectory #:nodoc:
34
+ attr_reader :data
35
+
36
+ def initialize(base, destination, data, config={})
37
+ @data = data
38
+ super(base, destination, config)
39
+ end
40
+
41
+ # Checks if the content of the file at the destination is identical to the rendered result.
42
+ #
43
+ # ==== Returns
44
+ # Boolean:: true if it is identical, false otherwise.
45
+ #
46
+ def identical?
47
+ exists? && File.binread(destination) == render
48
+ end
49
+
50
+ # Holds the content to be added to the file.
51
+ #
52
+ def render
53
+ @render ||= if data.is_a?(Proc)
54
+ data.call
55
+ else
56
+ data
57
+ end
58
+ end
59
+
60
+ def invoke!
61
+ invoke_with_conflict_check do
62
+ FileUtils.mkdir_p(File.dirname(destination))
63
+ File.open(destination, 'wb') { |f| f.write render }
64
+ end
65
+ given_destination
66
+ end
67
+
68
+ protected
69
+
70
+ # Now on conflict we check if the file is identical or not.
71
+ #
72
+ def on_conflict_behavior(&block)
73
+ if identical?
74
+ say_status :identical, :blue
75
+ else
76
+ options = base.options.merge(config)
77
+ force_or_skip_or_conflict(options[:force], options[:skip], &block)
78
+ end
79
+ end
80
+
81
+ # If force is true, run the action, otherwise check if it's not being
82
+ # skipped. If both are false, show the file_collision menu, if the menu
83
+ # returns true, force it, otherwise skip.
84
+ #
85
+ def force_or_skip_or_conflict(force, skip, &block)
86
+ if force
87
+ say_status :force, :yellow
88
+ block.call unless pretend?
89
+ elsif skip
90
+ say_status :skip, :yellow
91
+ else
92
+ say_status :conflict, :red
93
+ force_or_skip_or_conflict(force_on_collision?, true, &block)
94
+ end
95
+ end
96
+
97
+ # Shows the file collision menu to the user and gets the result.
98
+ #
99
+ def force_on_collision?
100
+ base.shell.file_collision(destination){ render }
101
+ end
102
+
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,57 @@
1
+ require 'thor/actions/create_file'
2
+
3
+ class Thor
4
+ module Actions
5
+
6
+ # Create a new file relative to the destination root from the given source.
7
+ #
8
+ # ==== Parameters
9
+ # destination<String>:: the relative path to the destination root.
10
+ # source<String|NilClass>:: the relative path to the source root.
11
+ # config<Hash>:: give :verbose => false to not log the status.
12
+ # :: give :symbolic => false for hard link.
13
+ #
14
+ # ==== Examples
15
+ #
16
+ # create_link "config/apache.conf", "/etc/apache.conf"
17
+ #
18
+ def create_link(destination, *args, &block)
19
+ config = args.last.is_a?(Hash) ? args.pop : {}
20
+ source = args.first
21
+ action CreateLink.new(self, destination, source, config)
22
+ end
23
+ alias :add_link :create_link
24
+
25
+ # CreateLink is a subset of CreateFile, which instead of taking a block of
26
+ # data, just takes a source string from the user.
27
+ #
28
+ class CreateLink < CreateFile #:nodoc:
29
+ attr_reader :data
30
+
31
+ # Checks if the content of the file at the destination is identical to the rendered result.
32
+ #
33
+ # ==== Returns
34
+ # Boolean:: true if it is identical, false otherwise.
35
+ #
36
+ def identical?
37
+ exists? && File.identical?(render, destination)
38
+ end
39
+
40
+ def invoke!
41
+ invoke_with_conflict_check do
42
+ FileUtils.mkdir_p(File.dirname(destination))
43
+ # Create a symlink by default
44
+ config[:symbolic] ||= true
45
+ File.unlink(destination) if exists?
46
+ if config[:symbolic]
47
+ File.symlink(render, destination)
48
+ else
49
+ File.link(render, destination)
50
+ end
51
+ end
52
+ given_destination
53
+ end
54
+
55
+ end
56
+ end
57
+ end