interakt_rails 0.0.1.4 → 0.0.1.5

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTUyZjgzYmRmMDBiNzUwNjc3YjYwN2U4NGVmNWIwM2U2MmJhZTg5Ng==
4
+ Yjk2YjE1OTJjODkxZTZmM2NlNTI3ODdhYzI1ZTExM2Q0M2Y0MGFmMw==
5
5
  data.tar.gz: !binary |-
6
- NWRhYzkxMTllYzNmZWE4NDQ3YzgzNDkwZTc1NmIwZGUxZGE4MDMwNQ==
6
+ MTY4M2RlYjBjNDBmNjY2Mzg0YTM1ZWJhNWNmMWY3YmU0OTZiMTY4ZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZDgxNDUyZDcxNDU1YzkyNWQ1ZTEzYmFhMzM0MGZiYzE0Y2ZkNjc2YjliZTRh
10
- ZGE3NDI5NzE2ODMyYzA3NDA2N2Y2YTU3OGM1YTBhYjk5YTNmNDE5Yzc2NjU1
11
- MWY2OGVhZTRhOWFiYTg2NTQ0NjQzNzUxOTJiNTVlN2U1Njk5MjI=
9
+ ZWU2NmI1NzJjMmNkNDUwZDgxNGM2YTE4M2MyNmU3NmE0ZWYzYmVkOWJmNjUy
10
+ NWEzNzBmYzEwOGQyNzhmOWRkMjczYmE3N2E2NzJhNjY1MDU1NTUzYTgyYTI3
11
+ Y2U0ZjNkM2Y0OGVlMjM5ZGExYzRiY2U3N2E2ZDhhYmFmMmY4Mjk=
12
12
  data.tar.gz: !binary |-
13
- MWM5YjczYzA3NTgxYjRkZTA1MTIyNTQ1MzY0M2NmNDY2N2Q4NDFlNmViYWI0
14
- YTFmMjE2NjIyODBkMDI0ZTAwMWU5MGQ0ZmIzYTllMzEwNDE3ZDU2YzAxNjMw
15
- NGE5ZDU3MWZhMDMwZGJhN2IyMTNlY2Y0ODgxNTJkZmNmMTVmOTY=
13
+ NWJkMmI2ZDEwMmM5YTZmMzM0MjlhODVlN2VkMTYwMzJiZTNmM2RjOGM4YWU1
14
+ NTA1YzA3ZDcyYWNhOTVjMmQ3OTBhZTU1MGJhY2U3NWQ4YjJiMWU4NjQ2Mjll
15
+ YWNjOTI1ZTdkYzkzNDRlOWVjYmU1NjA4MGE2ZWQ2NDdlOGI5MzQ=
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in interakthq_rails.gemspec
3
+ # Specify your gem's dependencies in interakt_rails.gemspec
4
4
  gemspec
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # InterakthqRails
1
+ # InteraktRails
2
2
 
3
3
  TODO: Write a gem description
4
4
 
@@ -6,7 +6,7 @@ TODO: Write a gem description
6
6
 
7
7
  Add this line to your application's Gemfile:
8
8
 
9
- gem 'interakthq_rails'
9
+ gem 'interakt_rails'
10
10
 
11
11
  And then execute:
12
12
 
@@ -14,7 +14,7 @@ And then execute:
14
14
 
15
15
  Or install it yourself as:
16
16
 
17
- $ gem install interakthq_rails
17
+ $ gem install interakt_rails
18
18
 
19
19
  ## Usage
20
20
 
@@ -1,14 +1,14 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'interakthq_rails/version'
4
+ require 'interakt_rails/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "interakt_rails"
8
- spec.version = InterakthqRails::VERSION
8
+ spec.version = InteraktRails::VERSION
9
9
  spec.authors = ["Manoj"]
10
10
  spec.email = ["manoj.delhi24@gmail.com"]
11
- spec.description = %q{Import your users data into interaktHQ}
11
+ spec.description = %q{Import your users data into interakt}
12
12
  spec.summary = %q{The Customer Interaction HeadQuarter. Easily interact with every single user of your app.}
13
13
  spec.homepage = "http://interakt.co/"
14
14
  spec.license = "MIT"
@@ -1,6 +1,6 @@
1
- require "interakthq_rails/user_validator"
1
+ require "interakt_rails/user_validator"
2
2
 
3
- module InterakthqRails
3
+ module InteraktRails
4
4
  class Import
5
5
  include UserValidator
6
6
 
@@ -12,7 +12,7 @@ module InterakthqRails
12
12
  end
13
13
 
14
14
  def self.uri
15
- host = (Rails.env.production? ? "http://interakthq.com" : "http://localhost:3000")
15
+ host = (Rails.env.production? ? "http://interakt.co" : "http://localhost:3000")
16
16
  URI.parse(host + "/api/v1/members/import_data")
17
17
  end
18
18
 
@@ -40,7 +40,7 @@ module InterakthqRails
40
40
 
41
41
  def send_members( members)
42
42
  request = Net::HTTP::Post.new(uri.request_uri)
43
- request.basic_auth(InterakthqRails.config.app_id, InterakthqRails.config.api_key)
43
+ request.basic_auth(InteraktRails.config.app_id, InteraktRails.config.api_key)
44
44
  request["Content-Type"] = "application/json"
45
45
  request.body = {members: members}.to_json
46
46
 
@@ -60,7 +60,7 @@ module InterakthqRails
60
60
 
61
61
 
62
62
  def custom_data_attributes_for_member(member)
63
- if( (custom_data = InterakthqRails.config.user.custom_data).present?)
63
+ if( (custom_data = InteraktRails.config.user.custom_data).present?)
64
64
  custom_data.inject({}) do |hash, (key, value)|
65
65
  hash[key] = ( value.kind_of?(Proc) ? value.call(member) : member.send( value))
66
66
  hash
@@ -0,0 +1,12 @@
1
+ namespace :interakt do
2
+
3
+ desc "Import your users data into interakt"
4
+ task :import => :environment do
5
+ begin
6
+ InteraktRails::Import.start
7
+ rescue => e
8
+ puts e.message
9
+ end
10
+ end
11
+
12
+ end
@@ -1,7 +1,7 @@
1
- module InterakthqRails
1
+ module InteraktRails
2
2
  class Railtie < Rails::Railtie
3
3
  rake_tasks do
4
- load 'interakthq_rails/interakthq.rake'
4
+ load 'interakt_rails/interakt.rake'
5
5
  end
6
6
  end
7
7
  end
@@ -1,6 +1,6 @@
1
1
  require 'active_support'
2
2
 
3
- module InterakthqRails
3
+ module InteraktRails
4
4
  class Setting
5
5
  cattr_accessor :app_id, :api_key
6
6
  cattr_accessor :user do
@@ -1,11 +1,11 @@
1
- module InterakthqRails
1
+ module InteraktRails
2
2
  module UserValidator
3
3
  EXPECTED_ATTRIBUTES = ['email', 'name', 'first_name', 'last_name','firstname', 'lastname', 'created_at']
4
4
 
5
5
  def check_basic_validation
6
6
  raise 'We only supports ActiveRecord' unless (defined?(ActiveRecord::Base) && (model_name < ActiveRecord::Base))
7
- raise "You have to add 'app_id' in your 'config/initializers/interakthq.rb' file first" unless InterakthqRails.config.app_id.present?
8
- raise "You have to add 'api_key' in your 'config/initializers/interakthq.rb' file first" unless InterakthqRails.config.api_key.present?
7
+ raise "You have to add 'app_id' in your 'config/initializers/interakt.rb' file first" unless InteraktRails.config.app_id.present?
8
+ raise "You have to add 'api_key' in your 'config/initializers/interakt.rb' file first" unless InteraktRails.config.api_key.present?
9
9
  raise "Your model must have 'email' field" unless model_name.new.respond_to? :email
10
10
 
11
11
  end
@@ -13,7 +13,7 @@ module InterakthqRails
13
13
  def model_name
14
14
  unless @model_name
15
15
  begin
16
- InterakthqRails.config.user.model.call
16
+ InteraktRails.config.user.model.call
17
17
  rescue Exception => e
18
18
  raise "Model doesn't exists"
19
19
  end
@@ -27,7 +27,7 @@ module InterakthqRails
27
27
  end
28
28
 
29
29
  def verify_reponse( response)
30
- raise "Your 'app_id' is not corrent. Please correct it in 'config/initializers/interakthq.rb'" if response.code.to_i == 401
30
+ raise "Your 'app_id' is not corrent. Please correct it in 'config/initializers/interakt.rb'" if response.code.to_i == 401
31
31
  raise "Something went wrong. Please report the issue." if response.code.to_i == 500
32
32
  response_verified = true
33
33
  end
@@ -0,0 +1,3 @@
1
+ module InteraktRails
2
+ VERSION = "0.0.1.5"
3
+ end
@@ -0,0 +1,12 @@
1
+ require "interakt_rails/setting"
2
+ require "interakt_rails/import"
3
+ require "interakt_rails/version"
4
+ require "interakt_rails/railtie"
5
+
6
+
7
+ module InteraktRails
8
+
9
+ def self.config
10
+ block_given? ? yield(Setting) : Setting
11
+ end
12
+ end
@@ -0,0 +1,21 @@
1
+ module Interakt
2
+ module Generators
3
+ class ConfigGenerator < ::Rails::Generators::Base
4
+
5
+ def self.source_root
6
+ File.dirname(__FILE__)
7
+ end
8
+
9
+ argument :app_id, :desc => "Your interakt app-id, which can be found here: https://www.interakt.co/api_keys"
10
+ argument :api_key, :desc => "An interakt API key, for various rake tasks", :optional => true
11
+
12
+ def create_initializer_file
13
+ @app_id = app_id
14
+ @api_key = api_key
15
+
16
+ template("interakt.rb.erb", "config/initializers/interakt.rb")
17
+ end
18
+
19
+ end
20
+ end
21
+ end
@@ -1,11 +1,11 @@
1
- InterakthqRails.config do |config|
2
- # == Interakthq app_id
1
+ InteraktRails.config do |config|
2
+ # == interakt app_id
3
3
  #
4
- config.app_id = ENV["INTERAKTHQ_APP_ID"] || "<%= @app_id %>"
4
+ config.app_id = ENV["interakt_APP_ID"] || "<%= @app_id %>"
5
5
 
6
- # == Interakthq API Key
7
- # This is required for some Interakthq rake tasks like importing your users;
8
- # you can generate one at https://www.interakthq.com/.
6
+ # == interakt API Key
7
+ # This is required for some interakt rake tasks like importing your users;
8
+ # you can generate one at https://www.interakt.co/.
9
9
  #
10
10
  <%- if @api_key -%>
11
11
  config.api_key = "<%= @api_key %>"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: interakt_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.4
4
+ version: 0.0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manoj
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - ! '>'
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
- description: Import your users data into interaktHQ
55
+ description: Import your users data into interakt
56
56
  email:
57
57
  - manoj.delhi24@gmail.com
58
58
  executables: []
@@ -65,16 +65,16 @@ files:
65
65
  - LICENSE.txt
66
66
  - README.md
67
67
  - Rakefile
68
- - interakthq_rails.gemspec
69
- - lib/interakthq_rails.rb
70
- - lib/interakthq_rails/import.rb
71
- - lib/interakthq_rails/interakthq.rake
72
- - lib/interakthq_rails/railtie.rb
73
- - lib/interakthq_rails/setting.rb
74
- - lib/interakthq_rails/user_validator.rb
75
- - lib/interakthq_rails/version.rb
76
- - lib/rails/generators/interakthq/config/config_generator.rb
77
- - lib/rails/generators/interakthq/config/interakthq.rb.erb
68
+ - interakt_rails.gemspec
69
+ - lib/interakt_rails.rb
70
+ - lib/interakt_rails/import.rb
71
+ - lib/interakt_rails/interakt.rake
72
+ - lib/interakt_rails/railtie.rb
73
+ - lib/interakt_rails/setting.rb
74
+ - lib/interakt_rails/user_validator.rb
75
+ - lib/interakt_rails/version.rb
76
+ - lib/rails/generators/interakt/config/config_generator.rb
77
+ - lib/rails/generators/interakt/config/interakt.rb.erb
78
78
  homepage: http://interakt.co/
79
79
  licenses:
80
80
  - MIT
@@ -1,12 +0,0 @@
1
- namespace :interakthq do
2
-
3
- desc "Import your users data into interaktHQ"
4
- task :import => :environment do
5
- begin
6
- InterakthqRails::Import.start
7
- rescue => e
8
- puts e.message
9
- end
10
- end
11
-
12
- end
@@ -1,3 +0,0 @@
1
- module InterakthqRails
2
- VERSION = "0.0.1.4"
3
- end
@@ -1,12 +0,0 @@
1
- require "interakthq_rails/setting"
2
- require "interakthq_rails/import"
3
- require "interakthq_rails/version"
4
- require "interakthq_rails/railtie"
5
-
6
-
7
- module InterakthqRails
8
-
9
- def self.config
10
- block_given? ? yield(Setting) : Setting
11
- end
12
- end
@@ -1,21 +0,0 @@
1
- module Interakthq
2
- module Generators
3
- class ConfigGenerator < ::Rails::Generators::Base
4
-
5
- def self.source_root
6
- File.dirname(__FILE__)
7
- end
8
-
9
- argument :app_id, :desc => "Your Interakthq app-id, which can be found here: https://www.interakthq.com/api_keys"
10
- argument :api_key, :desc => "An Interakthq API key, for various rake tasks", :optional => true
11
-
12
- def create_initializer_file
13
- @app_id = app_id
14
- @api_key = api_key
15
-
16
- template("interakthq.rb.erb", "config/initializers/interakthq.rb")
17
- end
18
-
19
- end
20
- end
21
- end