reflection 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,10 @@
1
+ === current HEAD
2
+
3
+ === 0.4.5 / 2009-11-19
4
+
5
+ * enhancements
6
+ * Added --force option to skip moments of user-interaction
7
+ * Replaced FileUtils#methods with its native brothers to gain more speed (and to preserve your cpu)
8
+
9
+ * fixed
10
+ * Fixed no-working repository-pull
@@ -103,6 +103,7 @@ If you have a <tt>reflection.yml</tt> config file in your current application-de
103
103
  --rails-env [ENV] Rails environment to instrument
104
104
  --write [FILE] Create a configuration FILE from the current commandline options
105
105
  -v, --verbose Include debug information in output
106
+ --force Hide tedious warnings
106
107
 
107
108
 
108
109
  == Note on Patches/Pull Requests
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{reflection}
8
- s.version = "0.4.4"
8
+ s.version = "0.4.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andreas Wolff"]
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
26
26
  ".document",
27
27
  ".gitignore",
28
28
  ".yardoc",
29
+ "History.rdoc",
29
30
  "LICENSE",
30
31
  "README.rdoc",
31
32
  "Rakefile",
data/TODO CHANGED
@@ -5,4 +5,5 @@
5
5
  + Allow to apply any (git) version, not just the latest
6
6
  + Add cli option use tmp-apply (removes ~/.reflection/apply-dir after command)
7
7
  + Allow collection of assets from Akamai and/or CloudFront (hm.. does that make sense?)
8
- + Add option to output --version
8
+ + Add option to output --version
9
+ - Remove ruby-git dependency
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.4
1
+ 0.4.5
@@ -1,5 +1,3 @@
1
- require 'fileutils'
2
-
3
1
  module Reflection
4
2
  module Command
5
3
  class Apply < Reflection::Command::Base
@@ -16,8 +14,10 @@ module Reflection
16
14
  stash_directory = Directory::Stash.new(Reflection::Repository.new(config.repository), 'apply')
17
15
  target_directory = Directory::Base.new(config.directory)
18
16
 
19
- get_user_approval_for_cleaning_target(target_directory)
20
- get_user_approval_for_apply_database_dump if config.rails_root
17
+ unless config.force
18
+ get_user_approval_for_cleaning_target(target_directory)
19
+ get_user_approval_for_apply_database_dump if config.rails_root
20
+ end
21
21
 
22
22
  verify_that_target_is_not_a_repository(target_directory)
23
23
 
@@ -45,8 +45,9 @@ module Reflection
45
45
 
46
46
  private
47
47
 
48
- def get_user_approval_for_cleaning_target(target_directory)
49
- puts "\nIn order to get a fresh copy of your files, Reflection will have to remove all files under '#{target_directory.path}'."
48
+ def get_user_approval_for_cleaning_target(target_directory)
49
+ puts "\nIn order to get a fresh copy of your files, "
50
+ puts "Reflection will have to remove all files under '#{target_directory.path}'."
50
51
  puts "If you are sure, hit <enter> to proceed.."
51
52
 
52
53
  unless STDIN.getc == 10
@@ -1,5 +1,3 @@
1
- require 'fileutils'
2
-
3
1
  module Reflection
4
2
  module Command
5
3
  class Stash < Reflection::Command::Base
@@ -48,7 +46,7 @@ module Reflection
48
46
  private
49
47
 
50
48
  def copy_stash_repository_git_index_to_target(source, target)
51
- FileUtils.cp_r(source, target)
49
+ %x(cp -R #{source} #{target})
52
50
  end
53
51
 
54
52
  def commit_and_push_files(repository_path, target)
@@ -58,8 +56,8 @@ module Reflection
58
56
  end
59
57
 
60
58
  def move_stash_repository_git_index_back(source, target)
61
- FileUtils.rm_r(File.join(target, "/.git"))
62
- FileUtils.mv(source, target)
59
+ %x(rm -r #{File.join(target, "/.git")})
60
+ %x(mv #{source} #{target})
63
61
  end
64
62
 
65
63
  end
@@ -15,6 +15,7 @@ module Reflection
15
15
  attr_accessor :rails_environment
16
16
  attr_accessor :store_configuration_path
17
17
  attr_accessor :verbose
18
+ attr_accessor :force
18
19
 
19
20
  def self.parse(args = [])
20
21
  config = Config.new
@@ -33,11 +34,12 @@ module Reflection
33
34
  def to_hash
34
35
  {
35
36
  :command => self.command,
36
- :repository => self.repository,
37
37
  :directory => self.directory,
38
+ :repository => self.repository,
38
39
  :rails_root => self.rails_root,
39
40
  :rails_environment => self.rails_environment,
40
- :verbose => self.verbose
41
+ :verbose => self.verbose,
42
+ :force => self.force
41
43
  }
42
44
  end
43
45
 
@@ -48,6 +50,7 @@ module Reflection
48
50
  self.rails_root = hash[:rails_root]
49
51
  self.rails_environment = hash[:rails_environment]
50
52
  self.verbose = Reflection.verbose = hash[:verbose]
53
+ self.force = hash[:force]
51
54
  end
52
55
 
53
56
  def write(path)
@@ -119,6 +122,10 @@ module Reflection
119
122
  self.verbose = true
120
123
  Reflection.verbose = true
121
124
  end
125
+
126
+ opts.on("--force", "Hide tedious warnings") do
127
+ self.force = true
128
+ end
122
129
  end
123
130
 
124
131
  opt_parser.parse!(args)
@@ -1,5 +1,3 @@
1
- require 'fileutils'
2
-
3
1
  module Reflection
4
2
  module Directory
5
3
  class Base
@@ -37,7 +35,7 @@ module Reflection
37
35
 
38
36
  def copy_git_index_to(target_path)
39
37
  Reflection.log.debug "Copying git-index '#{self.git_index}' to #{target_path}"
40
- FileUtils.cp_r(self.git_index, target_path)
38
+ %x(cp -R #{self.git_index} #{target_path})
41
39
  end
42
40
 
43
41
  def get_git_index_from(target_path)
@@ -50,8 +48,8 @@ module Reflection
50
48
 
51
49
  def move_content_to(target_path)
52
50
  Reflection.log.debug "Moving content to '#{target_path}'.."
53
- FileUtils.cp_r(File.join(self.path, '/.'), target_path)
54
- FileUtils.rm_r(File.join(self.path, '/'))
51
+ %x(cp -R #{File.join(self.path, '/.')} #{target_path})
52
+ %x(rm -rf #{self.path})
55
53
  end
56
54
 
57
55
  end
@@ -62,9 +62,8 @@ module Reflection
62
62
  end
63
63
 
64
64
  def pull
65
- repo = Git.open(self.path)
66
- Reflection.log.debug "Pulling.."
67
- Reflection.log.debug(repo.pull)
65
+ Reflection.log.debug "Pulling in #{self.path}.."
66
+ Reflection.log.debug(%x((cd #{self.path} && git pull --rebase)))
68
67
  end
69
68
 
70
69
  end
@@ -8,7 +8,8 @@ describe Reflection::Config do
8
8
  :directory => 'dir',
9
9
  :rails_root => "rails_root",
10
10
  :rails_environment => 'development',
11
- :verbose => true
11
+ :verbose => true,
12
+ :force => false
12
13
  }
13
14
  end
14
15
 
@@ -51,6 +52,7 @@ describe Reflection::Config do
51
52
  @config.rails_root = 'rails_root'
52
53
  @config.rails_environment = 'development'
53
54
  @config.verbose = true
55
+ @config.force = false
54
56
  @config.to_hash.should == @valid_options
55
57
  end
56
58
  end
@@ -65,6 +67,7 @@ describe Reflection::Config do
65
67
  @config.rails_root.should eql('rails_root')
66
68
  @config.rails_environment.should eql('development')
67
69
  @config.verbose.should be_true
70
+ @config.force.should be_false
68
71
  end
69
72
  end
70
73
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reflection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Wolff
@@ -45,6 +45,7 @@ files:
45
45
  - .document
46
46
  - .gitignore
47
47
  - .yardoc
48
+ - History.rdoc
48
49
  - LICENSE
49
50
  - README.rdoc
50
51
  - Rakefile