rumination 0.1.0 → 0.2.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 +4 -4
- data/lib/rumination/dev_user.rb +20 -0
- data/lib/rumination/version.rb +1 -1
- data/lib/rumination.rb +1 -1
- data/rumination.gemspec +2 -0
- metadata +16 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7aeb6fcd294c5e300ee577f0f9665fa9bf561bb9
|
|
4
|
+
data.tar.gz: 2b9ab3469d92005f262d9b98e47fed3f1562c4db
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1274946e8805c1c95c4cc88ddc9ca3fbeee9023983bac15ded7e4af88c79dde10ac79903714f16166093713716a8f499292b03e8052effce71d515143a1b84bd
|
|
7
|
+
data.tar.gz: a923229128ab26253e63902103cd28c50882e187ad2ca38eb3739ed999cf1b1c99abeeeb9051ffce3b8b141075ecd00ec2e19b13d733706cf0f2e391ecba9256
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require "active_model"
|
|
2
|
+
|
|
3
|
+
module Rumination
|
|
4
|
+
class DevUser
|
|
5
|
+
CannotBeInitialized = Class.new(RuntimeError)
|
|
6
|
+
include ActiveModel::Model
|
|
7
|
+
attr_accessor :name, :host, :password, :email
|
|
8
|
+
|
|
9
|
+
def initialize args={}
|
|
10
|
+
super
|
|
11
|
+
self.name ||= ENV["USER"]
|
|
12
|
+
raise CannotBeInitialized, "Can't guess dev user name" unless self.name.present?
|
|
13
|
+
self.password ||= ENV["DEV_PASSWORD"]
|
|
14
|
+
raise CannotBeInitialized, "Can't guess dev user password" unless self.password.present?
|
|
15
|
+
self.host ||= ENV["DEV_HOST"]
|
|
16
|
+
raise CannotBeInitialized, "Can't guess dev user email" unless self.email.present? || self.host.present?
|
|
17
|
+
self.email ||= [name, host].join("@")
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
data/lib/rumination/version.rb
CHANGED
data/lib/rumination.rb
CHANGED
data/rumination.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rumination
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Artem Baguinski
|
|
@@ -52,6 +52,20 @@ dependencies:
|
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '3.0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: activemodel
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '0'
|
|
55
69
|
description: development utilities
|
|
56
70
|
email:
|
|
57
71
|
- abaguinski@depraktijkindex.nl
|
|
@@ -69,6 +83,7 @@ files:
|
|
|
69
83
|
- bin/console
|
|
70
84
|
- bin/setup
|
|
71
85
|
- lib/rumination.rb
|
|
86
|
+
- lib/rumination/dev_user.rb
|
|
72
87
|
- lib/rumination/version.rb
|
|
73
88
|
- rumination.gemspec
|
|
74
89
|
homepage: https://github.com/artm/rumination
|