amember_pro 0.1.0 → 0.1.1

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.
@@ -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 = "AMEMBER_PRO = YAML::load_file(Rails.root + '#{AMEMBER_YAML_FILE}')"
75
- File.open(AMEMBER_INITIALIZERS_FILE, "w+") {|f| f.write(code)}
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
@@ -1,3 +1,3 @@
1
1
  module AmemberPro
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-06-27 00:00:00.000000000 Z
12
+ date: 2014-07-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler