comufyrails 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/comufyrails.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'rails'
2
2
 
3
3
  require "comufyrails/version"
4
+ require "comufyrails/connection"
4
5
  require 'comufyrails/railtie' if defined?(Rails)
5
6
 
6
7
  module Comufyrails
@@ -0,0 +1,10 @@
1
+
2
+ module Comufyrails::Connection
3
+
4
+ # aim of this module is to will be to allow sync/async connections to be sent to our heroku servers
5
+ # to be processed and then returned (or the error message returned)
6
+
7
+ # with this in mind, we will probably be using https://github.com/igrigorik/em-synchrony
8
+ # with apost and post requests to send and receive data. It'll use the information generated from the Railtie
9
+ # to know what/who is sending and to where.
10
+ end
@@ -3,23 +3,20 @@ require 'rails'
3
3
  class Comufyrails::Railtie < Rails::Railtie
4
4
 
5
5
  # this allows users to manage settings just like they manage rails settings
6
- config.comufy = ActiveSupport::OrderedOptions.new
6
+ config.comufy_rails = ActiveSupport::OrderedOptions.new # enable namespaced configuration in Rails environment
7
7
 
8
8
  rake_tasks do
9
9
  # load "path/to/my_railtie.tasks"
10
10
  end
11
11
 
12
- initializer "comufyrails.configure_settings" do |app|
13
- #unless defined?(COMUFY)
14
- # silence_warnings { Object.const_set "COMUFY", app.config.comufy }
15
- #end
12
+ initializer "comufyrails.configure" do |app|
16
13
  Comufyrails.configure do |config|
17
- config.app_name = app.config.comufy.delete(:app_name) || self.app_name
18
- config.username = app.config.comufy.delete(:username) || self.username
19
- config.password = app.config.comufy.delete(:password) || self.password
20
- config.access_token = app.config.comufy.delete(:access_token) || self.access_token
21
- config.expiry_date = app.config.comufy.delete(:expiry_date) || self.expiry_date
22
- config.base_api_url = app.config.comufy.delete(:base_api_url) || self.base_api_url
14
+ config.app_name = app.config.comufy_rails[:app_name] || Comufyrails::Railtie.app_name
15
+ config.username = app.config.comufy_rails[:username] || Comufyrails::Railtie.username
16
+ config.password = app.config.comufy_rails[:password] || Comufyrails::Railtie.password
17
+ config.access_token = app.config.comufy_rails[:access_token] || Comufyrails::Railtie.access_token
18
+ config.expiry_time = app.config.comufy_rails[:expiry_time] || Comufyrails::Railtie.expiry_time
19
+ config.base_api_url = app.config.comufy_rails[:base_api_url] || Comufyrails::Railtie.base_api_url
23
20
  end
24
21
  end
25
22
 
@@ -47,7 +44,7 @@ class Comufyrails::Railtie < Rails::Railtie
47
44
  ENV.fetch('COMUFY_TOKEN', nil)
48
45
  end
49
46
 
50
- def self.expiry_token
47
+ def self.expiry_time
51
48
  ENV.fetch('COMUFY_EXPIRY_TIME', nil)
52
49
  end
53
50
 
@@ -1,3 +1,3 @@
1
1
  module Comufyrails
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comufyrails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -74,6 +74,7 @@ files:
74
74
  - Rakefile
75
75
  - comufyrails.gemspec
76
76
  - lib/comufyrails.rb
77
+ - lib/comufyrails/connection.rb
77
78
  - lib/comufyrails/railtie.rb
78
79
  - lib/comufyrails/version.rb
79
80
  homepage: https://github.com/plcstevens/comufyrails
@@ -99,5 +100,5 @@ rubyforge_project:
99
100
  rubygems_version: 1.8.24
100
101
  signing_key:
101
102
  specification_version: 3
102
- summary: comufyrails-0.0.1
103
+ summary: comufyrails-0.0.2
103
104
  test_files: []