amember_pro 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/amember_pro.rb +10 -5
- data/lib/amember_pro/version.rb +1 -1
- metadata +2 -2
data/lib/amember_pro.rb
CHANGED
@@ -61,18 +61,23 @@ module AmemberPro
|
|
61
61
|
class << self
|
62
62
|
def rails_config_make
|
63
63
|
raise 'Rails config directory not found.' unless rails_config_dir_exists?
|
64
|
-
raise 'Amember config yaml file already exists.' if amember_config_file_exists?
|
65
64
|
raise 'Rails config/initializers directory not found.' unless rails_initializers_dir_exists?
|
66
|
-
|
67
|
-
write_yaml_config_file
|
65
|
+
write_yaml_config_file unless amember_config_file_exists?
|
68
66
|
write_initializers_file
|
69
67
|
end
|
70
68
|
|
71
69
|
private
|
72
70
|
|
73
71
|
def write_initializers_file
|
74
|
-
code =
|
75
|
-
|
72
|
+
code = <<-CODE
|
73
|
+
AMEMBER_PRO = YAML::load_file(Rails.root + '#{AMEMBER_YAML_FILE}');
|
74
|
+
AmemberPro.new(AMEMBER_PRO['url'], AMEMBER_PRO['access_key'])
|
75
|
+
CODE
|
76
|
+
File.open(AMEMBER_INITIALIZERS_FILE, "w+") do |f|
|
77
|
+
code.each_line do |line|
|
78
|
+
f.write("#{line.strip!}\n")
|
79
|
+
end
|
80
|
+
end
|
76
81
|
end
|
77
82
|
|
78
83
|
def write_yaml_config_file
|
data/lib/amember_pro/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amember_pro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-07-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|