zenbox 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/INSTALL +5 -5
- data/README.md +99 -99
- data/Rakefile +4 -4
- data/generators/{contextify → zenbox}/lib/insert_commands.rb +0 -0
- data/generators/{contextify → zenbox}/lib/rake_commands.rb +0 -0
- data/generators/{contextify → zenbox}/templates/initializer.rb +2 -2
- data/generators/{contextify/templates/contextify_tasks.rake → zenbox/templates/zenbox_tasks.rake} +7 -7
- data/generators/{contextify/contextify_generator.rb → zenbox/zenbox_generator.rb} +20 -20
- data/lib/rails/generators/{contextify/contextify_generator.rb → zenbox/zenbox_generator.rb} +21 -21
- data/lib/zenbox.rb +74 -1
- data/lib/{contextify → zenbox}/configuration.rb +7 -7
- data/lib/{contextify → zenbox}/rails.rb +4 -4
- data/lib/{contextify → zenbox}/railtie.rb +4 -4
- data/lib/{contextify → zenbox}/sender.rb +11 -11
- data/lib/{contextify → zenbox}/shared_tasks.rb +1 -1
- data/lib/zenbox/tasks.rb +50 -0
- data/lib/zenbox/user_helper.rb +39 -0
- data/lib/zenbox/version.rb +3 -0
- data/rails/init.rb +1 -1
- data/resources/README.md +3 -3
- data/{contextify.gemspec → zenbox.gemspec} +5 -5
- metadata +52 -56
- data/lib/contextify.rb +0 -74
- data/lib/contextify/tasks.rb +0 -50
- data/lib/contextify/user_helper.rb +0 -39
- data/lib/contextify/version.rb +0 -3
@@ -1,39 +0,0 @@
|
|
1
|
-
module Contextify
|
2
|
-
module UserHelper
|
3
|
-
def self.included(base)
|
4
|
-
base.extend(ClassMethods)
|
5
|
-
end
|
6
|
-
|
7
|
-
# TODO: Catch errors because of missing methods and prompt the
|
8
|
-
# user, "Tried to sync a non-existant method with
|
9
|
-
# contextify. Please make sure to implement #{method_name} on your
|
10
|
-
# model"
|
11
|
-
def contextify_sync!
|
12
|
-
Contextify.post(self.email, contextify_data)
|
13
|
-
end
|
14
|
-
|
15
|
-
def contextify_data(*fields)
|
16
|
-
fields = fields.empty? ? self.class.class_variable_get('@@contextify_fields') : fields
|
17
|
-
|
18
|
-
fields.inject({}) { |run, field| run[field] = self.send(field.to_sym); run }
|
19
|
-
end
|
20
|
-
|
21
|
-
module ClassMethods
|
22
|
-
def self.extended(base)
|
23
|
-
base.class_variable_set("@@contextify_fields", [])
|
24
|
-
|
25
|
-
Contextify.model = base.to_s
|
26
|
-
end
|
27
|
-
|
28
|
-
def contextify_fields=(*args)
|
29
|
-
self.class_variable_set("@@contextify_fields", args)
|
30
|
-
end
|
31
|
-
|
32
|
-
def contextify_user(*fields)
|
33
|
-
self.send(:contextify_fields=, *fields)
|
34
|
-
|
35
|
-
after_commit :contextify_sync!
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
data/lib/contextify/version.rb
DELETED