itamae 1.0.0.beta36 → 1.0.0.beta37

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 960d455a8ef4164798f47d7729c12bd9c4dc83c8
4
- data.tar.gz: 40891f58e09014321c39a2aa4d71ab8110c1ddf4
3
+ metadata.gz: b676dcff820c3b0bbf5f289bc16147d3c377c907
4
+ data.tar.gz: 20a076ed061d32a1b1a9e6db047e6e5d5d35c436
5
5
  SHA512:
6
- metadata.gz: 3e18a5e27dda2f409432f56b107a655e696ee3b8f5d64d1eca101c683e6ae8cc3d0877dd166c35c341eee167e3d3b6f2442c616a04205b281fdf57d24ab15683
7
- data.tar.gz: 79eadd9cae38c612f1dcd179aaf0096c3522d6ac6709bdf439c7450f9c943efe3b258845f9091c231acd05ca8e484d2c30a5bb64faaafbbd2f4466e2a371a22e
6
+ metadata.gz: 87f664da49330ed6a1e2e9bc645f63bb79af8eee6c22b4bd3aec5b38b96154098de80fdfe9a5e5f843d714e5712d7ca22bb842098e44858b2da1358f4460a657
7
+ data.tar.gz: f8bea8f07778c0750f32f7b16e69f4fd44c3970d833d1ac5fcead189f08b0976614c9ecc7d8a6f5ee4f7cfbfcf1a68af74893bf2d98d757370aebb3cd61b9547
data/README.md CHANGED
@@ -68,6 +68,8 @@ $ bundle exec rake spec
68
68
 
69
69
  ## Contributing
70
70
 
71
+ If you have a problem, please [create an issue](https://github.com/ryotarai/itamae/issues/new) or a pull request.
72
+
71
73
  1. Fork it
72
74
  2. Create your feature branch (`git checkout -b my-new-feature`)
73
75
  3. Commit your changes (`git commit -am 'Add some feature'`)
@@ -6,7 +6,6 @@ require 'itamae/resource/remote_file'
6
6
  require 'itamae/resource/directory'
7
7
  require 'itamae/resource/template'
8
8
  require 'itamae/resource/execute'
9
- require 'itamae/resource/mail_alias'
10
9
  require 'itamae/resource/service'
11
10
  require 'itamae/resource/link'
12
11
  require 'itamae/resource/local_ruby_block'
@@ -22,11 +21,23 @@ module Itamae
22
21
 
23
22
  class << self
24
23
  def get_resource_class_name(method)
25
- method.to_s.split('_').map {|part| part.capitalize}.join
24
+ to_camel_case(method.to_s)
25
+ end
26
+
27
+ def get_resource_plugin_class_name(method)
28
+ '::Itamae::Plugin::Resource::' + to_camel_case(method.to_s)
29
+ end
30
+
31
+ def to_camel_case(str)
32
+ str.split('_').map {|part| part.capitalize}.join
26
33
  end
27
34
 
28
35
  def get_resource_class(method)
29
- const_get(get_resource_class_name(method))
36
+ begin
37
+ const_get(get_resource_class_name(method))
38
+ rescue NameError => e
39
+ const_get(get_resource_plugin_class_name(method))
40
+ end
30
41
  end
31
42
 
32
43
  def parse_description(desc)
@@ -1 +1 @@
1
- 1.0.0.beta36
1
+ 1.0.0.beta37
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta36
4
+ version: 1.0.0.beta37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-27 00:00:00.000000000 Z
11
+ date: 2014-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -170,7 +170,6 @@ files:
170
170
  - lib/itamae/resource/git.rb
171
171
  - lib/itamae/resource/link.rb
172
172
  - lib/itamae/resource/local_ruby_block.rb
173
- - lib/itamae/resource/mail_alias.rb
174
173
  - lib/itamae/resource/package.rb
175
174
  - lib/itamae/resource/remote_file.rb
176
175
  - lib/itamae/resource/service.rb
@@ -1,17 +0,0 @@
1
- require 'itamae'
2
-
3
- module Itamae
4
- module Resource
5
- class MailAlias < Base
6
- define_attribute :action, default: :create
7
- define_attribute :mail_alias, type: String, default_name: true
8
- define_attribute :recipient, type: String, required: true
9
-
10
- def create_action(options)
11
- if !run_specinfra(:check_mail_alias_is_aliased_to, mail_alias, recipient)
12
- run_specinfra(:add_mail_alias, mail_alias, recipient)
13
- end
14
- end
15
- end
16
- end
17
- end