happy_place 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 699c95a15b39dc929671551c1579537fae0b811a
4
- data.tar.gz: 4c3226374364afb61ccaa75d5f64e19c06593dae
3
+ metadata.gz: d21a1e55117569cf396c9792253cc152416d2e91
4
+ data.tar.gz: a2720f9d9a5c7ccf2de5c73f57fead6dfdea5b23
5
5
  SHA512:
6
- metadata.gz: dbee823d359531914b2d98058d021deba71467cdfd359d847b700d9775ab6bab372bf2b5bb62d10c5dd66c8c79712755bef6323073ae023ba1cac2011287c687
7
- data.tar.gz: e9cc999efbab6d768e327747c787ecb4632c71e100b1d465ab5d9de1255f62752930004e1932549369f6f3f38730b96c0a93bba796160ec77f4a8d423c0d3ab1
6
+ metadata.gz: 46175b9932b189dbdf0b8499dcc7ec9786c4bf13d497ffdff75cf353835d97becc06cd796a809c7de6a8f942c95e8547533b47dc77957aa304bef2b33fb9af18
7
+ data.tar.gz: 14ffcfb4d171919933ed858bd98e2543c8ac13aae7a952992bcc6fd0a1cdee6d7e5829394c2d7c5b151f714eb05e3259df5876a934a985662506eef0c69b1659
@@ -48,12 +48,12 @@ module HappyPlace
48
48
  (build_partials_string(partials) + hash_to_js_args(args)).join(", ") +
49
49
  "});"
50
50
  else
51
- built_args = "({" + hash_to_js_args(args).join(", ") + "});"
51
+ built_args = "(" + hash_to_js_args(args) + ");"
52
52
  end
53
53
  end
54
54
 
55
- def auto_exec_function(class_and_function, args, container)
56
- script_string = "<script type='application/javascript'>jQuery(document).ready(function($) {" + render_to_string(js: class_and_function + args) + "});</script>"
55
+ def auto_exec_function(class_and_function, args, container=nil)
56
+ script_string = "<script type='application/javascript'>(function(){" + render_to_string(js: class_and_function + args) + "})();</script>"
57
57
  if container.present?
58
58
  script_string = container[:open] + script_string + container[:close]
59
59
  end
@@ -61,12 +61,13 @@ module HappyPlace
61
61
  end
62
62
 
63
63
  def hash_to_js_args(args)
64
- js_args = []
64
+ # js_args = []
65
65
 
66
- args.each_pair do |k, v|
67
- js_args << (k.to_s + ": " + "'#{v}'")
68
- end
69
- js_args
66
+ # args.each_pair do |k, v|
67
+ # js_args << (k.to_s + ": " + "'#{v}'")
68
+ # end
69
+ # js_args
70
+ args.to_json
70
71
  end
71
72
 
72
73
  def build_partials_string(partials)
@@ -4,7 +4,7 @@ module HappyPlace
4
4
  class Railtie < Rails::Railtie
5
5
  initializer "your_gem_name.action_controller" do
6
6
  ActiveSupport.on_load(:action_controller) do
7
- puts "Extending #{self} with YourGemsModuleName::Controller"
7
+ puts "Extending #{self} with HappyPlace::Controller"
8
8
  # ActionController::Base gets a method that allows controllers to include the new behavior
9
9
  include HappyPlace::Controller # ActiveSupport::Concern
10
10
  end
@@ -1,3 +1,3 @@
1
1
  module HappyPlace
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: happy_place
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Piccolo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-09 00:00:00.000000000 Z
11
+ date: 2014-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails