dice_bag 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ module DiceBag
11
11
  # it needs to overwrite this method and return a string with the new location as relative
12
12
  # path inside the project.
13
13
  def templates_location
14
- Project.config_dir
14
+ 'config'
15
15
  end
16
16
 
17
17
  class << self
@@ -16,7 +16,7 @@ module DiceBag
16
16
  end
17
17
  @filename = File.basename(name)
18
18
  @file = name
19
- @template_location = location || Project.config_dir
19
+ @template_location = location
20
20
  end
21
21
 
22
22
  def create_file
@@ -10,40 +10,15 @@ module DiceBag
10
10
  end
11
11
 
12
12
  def self.config_files(filename)
13
- File.join(self.root, self.config_dir, filename)
14
- end
15
-
16
- # dotNet apps do not have the templates in config/ but in the root of the project
17
- # TODO: detect dotNet instead of detecting rails
18
- def self.config_dir
19
- defined?(Rails) ? 'config' : "."
13
+ File.join(self.root, filename)
20
14
  end
21
15
 
22
16
  def self.root
23
17
  Dir.pwd
24
18
  end
25
19
 
26
- #local templates always takes preference over generated templates
27
20
  def self.templates_to_generate
28
- dice_templates = Dir["**/*.dice"]
29
-
30
- # The following ways of identifying template files will be removed prior
31
- # to v1.
32
- generated_templates = Dir[Project.config_files("**/*.erb")]
33
- custom_templates = Dir[Project.config_files("**/*.erb.local")]
34
- dotNetTemplates = Dir[Project.config_files("**/*.config.template")]
35
-
36
- legacy_files = generated_templates + custom_templates + dotNetTemplates
37
- legacy_files.each do |file|
38
- $stderr.puts "DEPRECATION WARNING: Use '.dice' file extension instead for '#{file}'"
39
- end
40
-
41
- all_files = legacy_files + dice_templates
42
-
43
- cleaned_templates = all_files.delete_if {|file| custom_templates.include?(file + '.local')}
44
- dotNetTemplates = dotNetTemplates.delete_if {|file| file.include?("/bin/")}
45
- (cleaned_templates + dotNetTemplates).map { |template| File.basename(template) }
21
+ Dir['**/*.dice']
46
22
  end
47
-
48
23
  end
49
24
  end
@@ -32,7 +32,7 @@ module DiceBag
32
32
 
33
33
  return unless config_file.should_write?(contents)
34
34
  config_file.write(contents)
35
- puts "file #{Project.config_dir}/#{config_file.file} created"
35
+ puts "File '#{config_file.file}' created"
36
36
  end
37
37
 
38
38
  end
@@ -5,8 +5,8 @@
5
5
  require 'dice_bag'
6
6
 
7
7
  module DiceBag
8
- class CommonTemplatesBag < AvailableTemplates
9
-
8
+ class CommonTemplatesBag < AvailableTemplates
9
+
10
10
  def templates
11
11
  @needed_templates = []
12
12
  configured = Configuration.new
@@ -1,3 +1,3 @@
1
1
  module DiceBag
2
- VERSION = '0.5.0'
2
+ VERSION = '0.6.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dice_bag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-02-27 00:00:00.000000000Z
13
+ date: 2013-03-25 00:00:00.000000000Z
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rake
17
+ requirement: &71579610 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *71579610
15
26
  - !ruby/object:Gem::Dependency
16
27
  name: aruba
17
- requirement: &72996330 !ruby/object:Gem::Requirement
28
+ requirement: &71579360 !ruby/object:Gem::Requirement
18
29
  none: false
19
30
  requirements:
20
31
  - - ~>
@@ -22,10 +33,10 @@ dependencies:
22
33
  version: 0.5.1
23
34
  type: :development
24
35
  prerelease: false
25
- version_requirements: *72996330
36
+ version_requirements: *71579360
26
37
  - !ruby/object:Gem::Dependency
27
38
  name: rspec
28
- requirement: &72996080 !ruby/object:Gem::Requirement
39
+ requirement: &71579110 !ruby/object:Gem::Requirement
29
40
  none: false
30
41
  requirements:
31
42
  - - ~>
@@ -33,7 +44,7 @@ dependencies:
33
44
  version: '2.12'
34
45
  type: :development
35
46
  prerelease: false
36
- version_requirements: *72996080
47
+ version_requirements: *71579110
37
48
  description:
38
49
  email:
39
50
  - asmith@mdsol.com