fanforce 0.3.19 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fanforce (0.3.9)
4
+ fanforce (0.3.19)
5
5
  multi_json (~> 1.3.6)
6
6
  rack (> 1.0)
7
7
  rest-client (~> 1.6.7)
data/lib/fanforce/main.rb CHANGED
@@ -65,8 +65,8 @@ class Fanforce
65
65
  {success: true}
66
66
  end
67
67
 
68
- def track(behavior_id, req_params)
69
- post '/bie/track', req_params.merge(behavior_id: behavior_id)
68
+ def track(behavior_plugin_id, req_params)
69
+ post '/bie/track', req_params.merge(behavior_plugin_id: behavior_plugin_id)
70
70
  {success: true}
71
71
  end
72
72
 
@@ -96,7 +96,7 @@ class Fanforce
96
96
  @auth_hash ||= {}
97
97
  return @auth_hash if is_blank?(auth_data)
98
98
  auth_data = auth_data.is_a?(Hash) ? auth_data.symbolize_keys : {api_key: auth_data.to_s}
99
- @auth_hash.merge! remove_nil_values(api_key: auth_data[:api_key], fanforce_id: auth_data[:fanforce_id], fanforce_slug: auth_data[:fanforce_slug], app_id: auth_data[:app_id], module_id: auth_data[:module_id], behavior_id: auth_data[:behavior_id], widget_id: auth_data[:widget_id])
99
+ @auth_hash.merge! remove_nil_values(api_key: auth_data[:api_key], fanforce_id: auth_data[:fanforce_id], fanforce_slug: auth_data[:fanforce_slug], app_id: auth_data[:app_id], plugin_id: auth_data[:plugin_id], behavior_plugin_id: auth_data[:behavior_plugin_id], widget_id: auth_data[:widget_id])
100
100
  params.merge!(@auth_hash)
101
101
  valid_auth?
102
102
  end
@@ -21,14 +21,14 @@ module Fanforce::Utils
21
21
  def valid_fanforce_request?(params=@params)
22
22
  return false if !params.is_a?(Hash)
23
23
  return false if is_blank?(params[:fanforce_id])
24
- return false if is_blank?(params[:app_id]) and is_blank?(params[:behavior_id]) and is_blank?(params[:module_id]) and is_blank?(params[:widget_id])
24
+ return false if is_blank?(params[:app_id]) and is_blank?(params[:behavior_plugin_id]) and is_blank?(params[:plugin_id]) and is_blank?(params[:widget_id])
25
25
  return true
26
26
  end
27
27
 
28
28
  def valid_install_request?(params=@params)
29
29
  return false if !params.is_a?(Hash)
30
30
  return false if is_blank?(params[:fanforce_id])
31
- return false if is_blank?(params[:app_id]) and is_blank?(params[:behavior_id]) and is_blank?(params[:module_id]) and is_blank?(params[:widget_id])
31
+ return false if is_blank?(params[:app_id]) and is_blank?(params[:behavior_plugin_id]) and is_blank?(params[:plugin_id]) and is_blank?(params[:widget_id])
32
32
  return false if is_blank?(params[:api_key])
33
33
  return true
34
34
  end
@@ -36,7 +36,7 @@ module Fanforce::Utils
36
36
  def valid_uninstall_request?(params=@params)
37
37
  return false if !params.is_a?(Hash)
38
38
  return false if is_blank?(params[:fanforce_id])
39
- return false if is_blank?(params[:app_id]) and is_blank?(params[:behavior_id]) and is_blank?(params[:module_id]) and is_blank?(params[:widget_id])
39
+ return false if is_blank?(params[:app_id]) and is_blank?(params[:behavior_plugin_id]) and is_blank?(params[:plugin_id]) and is_blank?(params[:widget_id])
40
40
  return false if is_blank?(params[:api_key])
41
41
  return true
42
42
  end
@@ -48,23 +48,23 @@ module Fanforce::Utils
48
48
  def collect_known_params(params)
49
49
  params = params.symbolize_keys
50
50
  if is_present?(params[:app_id])
51
- plugin_type = :app
52
- plugin_id = params[:app_id]
53
- elsif is_present?(params[:behavior_id])
54
- plugin_type = :behavior
55
- plugin_id = params[:behavior_id]
56
- elsif is_present?(params[:module_id])
57
- plugin_type = :module
58
- plugin_id = params[:module_id]
51
+ addon_type = :app
52
+ addon_id = params[:app_id]
53
+ elsif is_present?(params[:behavior_plugin_id])
54
+ addon_type = :plugin
55
+ addon_id = params[:behavior_plugin_id]
56
+ elsif is_present?(params[:plugin_id])
57
+ addon_type = :plugin
58
+ addon_id = params[:plugin_id]
59
59
  elsif is_present?(params[:widget_id])
60
- plugin_type = :widget
61
- plugin_id = params[:widget_id]
60
+ addon_type = :widget
61
+ addon_id = params[:widget_id]
62
62
  end
63
- remove_nil_values(:"#{plugin_type}_id" => params[:"#{plugin_type}_id"], plugin_type: plugin_type, plugin_id: plugin_id, fanforce_id: params[:fanforce_id], fanforce_slug: params[:fanforce_slug], api_key: params[:api_key], session_id: params[:session_id])
63
+ remove_nil_values(:"#{addon_type}_id" => params[:"#{addon_type}_id"], addon_type: addon_type, addon_id: addon_id, fanforce_id: params[:fanforce_id], fanforce_slug: params[:fanforce_slug], api_key: params[:api_key], session_id: params[:session_id])
64
64
  end
65
65
 
66
66
  def remove_internal_params(params)
67
- params.clone.delete_if { |k,v| [:app_id, :behavior_id, :module_id, :widget_id, :plugin_type, :plugin_id, :fanforce_id, :fanforce_slug, :api_key].include? k }
67
+ params.clone.delete_if { |k,v| [:app_id, :behavior_plugin_id, :plugin_id, :widget_id, :addon_type, :addon_id, :fanforce_id, :fanforce_slug, :api_key].include? k }
68
68
  end
69
69
 
70
70
  def remove_sensitive_params(params)
@@ -1,3 +1,3 @@
1
1
  class Fanforce
2
- VERSION = "0.3.19"
2
+ VERSION = "0.4.1"
3
3
  end
data/lib/ff_globals.rb CHANGED
@@ -6,8 +6,7 @@ if !ENV['RACK_ENV'] or ENV['RACK_ENV'] == 'development'
6
6
  $WEBSITE_DOMAIN = $BASE_DOMAIN
7
7
 
8
8
  $SMARTURL_DOMAIN = 'fanforc.gg'
9
- $FF_MODULE_DOMAIN = 'ffmodule.gg'
10
- $FF_BEHAVIOR_DOMAIN = 'ffbehavior.gg'
9
+ $FF_PLUGIN_DOMAIN = 'ffmodule.gg'
11
10
  $FF_APP_DOMAIN = 'ffapp.gg'
12
11
  $FF_WIDGET_DOMAIN = 'ffwidget.gg'
13
12
 
@@ -25,8 +24,7 @@ elsif ENV['RACK_ENV'] == 'test'
25
24
  $WEBSITE_DOMAIN = $BASE_DOMAIN
26
25
 
27
26
  $SMARTURL_DOMAIN = 'fanforc.gg'
28
- $FF_MODULE_DOMAIN = 'ffmodule.gg'
29
- $FF_BEHAVIOR_DOMAIN = 'ffbehavior.gg'
27
+ $FF_PLUGIN_DOMAIN = 'ffmodule.gg'
30
28
  $FF_WIDGET_DOMAIN = 'ffwidget.gg'
31
29
  $FF_APP_DOMAIN = 'ffapp.gg'
32
30
 
@@ -44,8 +42,7 @@ elsif ENV['RACK_ENV'] == 'qa'
44
42
  $WEBSITE_DOMAIN = $BASE_DOMAIN
45
43
 
46
44
  $SMARTURL_DOMAIN = 'fanforc.us'
47
- $FF_MODULE_DOMAIN = 'ffmodule.us'
48
- $FF_BEHAVIOR_DOMAIN = 'ffbehavior.us'
45
+ $FF_PLUGIN_DOMAIN = 'ffmodule.us'
49
46
  $FF_APP_DOMAIN = 'ffapp.us'
50
47
  $FF_WIDGET_DOMAIN = 'ffwidget.us'
51
48
 
@@ -63,8 +60,7 @@ elsif ENV['RACK_ENV'] == 'production'
63
60
  $WEBSITE_DOMAIN = $BASE_DOMAIN
64
61
 
65
62
  $SMARTURL_DOMAIN = 'fanforce.io'
66
- $FF_MODULE_DOMAIN = 'ffmodule.io'
67
- $FF_BEHAVIOR_DOMAIN = 'ffbehavior.io'
63
+ $FF_PLUGIN_DOMAIN = 'ffmodule.io'
68
64
  $FF_APP_DOMAIN = 'ffapp.io'
69
65
  $FF_WIDGET_DOMAIN = 'ffwidget.io'
70
66
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fanforce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.19
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: