itamae 1.0.13 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f8e23322519a95a6c039667e300492abd4656c6c
4
- data.tar.gz: 3418652d414f5aa75d964d621610edfde90da9fc
3
+ metadata.gz: cf3ca04345f9e1c2f82343f422c6017c8ccdd982
4
+ data.tar.gz: ded46e740f4c6c1845df1dce58ca0f6fff546513
5
5
  SHA512:
6
- metadata.gz: 1a8e7ae7b0fa4bbbfa17fe9cfaedb9661b08519754da163dfdddfba436eff050dd850fa47bee695fd1cbd61f5b3478f626ae9ba0f6440c519fe92d991b43affc
7
- data.tar.gz: 83b243bf00cc40bcd269fc5fb41e1a52501976d3be681c17d5ceeec5159ab7c2dd8d41eca4da86049b5d050dc5a323fa585913ffeb3e2c7f5f3b820c8b261021
6
+ metadata.gz: db3709e61d480faa823f4ddce0d29f18f988f2f949dc2bd1272b5b0f2160a53070d9e8fd3f14f55a46acbfaa4ec1c70baef4a2958401396fd02fa2db9633b55f
7
+ data.tar.gz: c1244f6570776c26d621c6d4053a100a8f44452937240be45502e9af3412b170f91af127ee283fd5237ba56d14c9815340b7f8dd0d90d8047af4d95a3fd0db3d
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ ## v1.1.0
2
+
3
+ Incompatible changes
4
+
5
+ - `uid` and `gid` attributes of `user` resource accepts only Integer. (https://github.com/ryotarai/itamae/pull/65)
6
+
@@ -5,18 +5,18 @@ module Itamae
5
5
  class User < Base
6
6
  define_attribute :action, default: :create
7
7
  define_attribute :username, type: String, default_name: true
8
- define_attribute :gid, type: String
8
+ define_attribute :gid, type: Integer
9
9
  define_attribute :home, type: String
10
10
  define_attribute :password, type: String
11
11
  define_attribute :system_user, type: [TrueClass, FalseClass]
12
- define_attribute :uid, type: [String, Integer]
12
+ define_attribute :uid, type: Integer
13
13
 
14
14
  def set_current_attributes
15
15
  current.exist = exist?
16
16
 
17
17
  if current.exist
18
- current.uid = run_specinfra(:get_user_uid, attributes.username).stdout.strip
19
- current.gid = run_specinfra(:get_user_gid, attributes.username).stdout.strip
18
+ current.uid = run_specinfra(:get_user_uid, attributes.username).stdout.strip.to_i
19
+ current.gid = run_specinfra(:get_user_gid, attributes.username).stdout.strip.to_i
20
20
  current.home = run_specinfra(:get_user_home_directory, attributes.username).stdout.strip
21
21
  current.password = current_password
22
22
  end
@@ -24,12 +24,12 @@ module Itamae
24
24
 
25
25
  def action_create(options)
26
26
  if run_specinfra(:check_user_exists, attributes.username)
27
- if attributes.uid && attributes.uid.to_s != current.uid
27
+ if attributes.uid && attributes.uid != current.uid
28
28
  run_specinfra(:update_user_uid, attributes.username, attributes.uid)
29
29
  updated!
30
30
  end
31
31
 
32
- if attributes.gid && attributes.gid.to_s != current.gid
32
+ if attributes.gid && attributes.gid != current.gid
33
33
  run_specinfra(:update_user_gid, attributes.username, attributes.gid)
34
34
  updated!
35
35
  end
@@ -1 +1 @@
1
- 1.0.13
1
+ 1.1.0
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.13
4
+ version: 1.1.0
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-12-18 00:00:00.000000000 Z
11
+ date: 2014-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -146,6 +146,7 @@ extra_rdoc_files: []
146
146
  files:
147
147
  - ".gitignore"
148
148
  - ".rspec"
149
+ - CHANGELOG.md
149
150
  - Gemfile
150
151
  - LICENSE.txt
151
152
  - README.md