roguelytics 1.0.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +34 -0
  4. data/lib/generators/roguelytics/initializer_generator.rb +22 -0
  5. data/lib/generators/roguelytics_generator.rb +24 -0
  6. data/lib/roguelytics.rb +7 -0
  7. data/lib/roguelytics/has_roguelytics.rb +56 -0
  8. data/lib/roguelytics/process_job.rb +36 -0
  9. data/lib/roguelytics/railtie.rb +8 -0
  10. data/lib/roguelytics/version.rb +3 -0
  11. data/lib/roguelytics/view_helpers.rb +7 -0
  12. data/lib/tasks/roguelytics_tasks.rake +4 -0
  13. data/test/dummy/README.rdoc +28 -0
  14. data/test/dummy/Rakefile +6 -0
  15. data/test/dummy/app/assets/javascripts/application.js +13 -0
  16. data/test/dummy/app/assets/javascripts/articles.js +2 -0
  17. data/test/dummy/app/assets/javascripts/home.js +2 -0
  18. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  19. data/test/dummy/app/assets/stylesheets/articles.css +4 -0
  20. data/test/dummy/app/assets/stylesheets/home.css +4 -0
  21. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  22. data/test/dummy/app/controllers/application_controller.rb +5 -0
  23. data/test/dummy/app/controllers/articles_controller.rb +58 -0
  24. data/test/dummy/app/controllers/home_controller.rb +10 -0
  25. data/test/dummy/app/helpers/application_helper.rb +2 -0
  26. data/test/dummy/app/helpers/articles_helper.rb +2 -0
  27. data/test/dummy/app/helpers/home_helper.rb +2 -0
  28. data/test/dummy/app/models/article.rb +4 -0
  29. data/test/dummy/app/models/blog_entry.rb +7 -0
  30. data/test/dummy/app/views/articles/_form.html.erb +29 -0
  31. data/test/dummy/app/views/articles/edit.html.erb +6 -0
  32. data/test/dummy/app/views/articles/index.html.erb +31 -0
  33. data/test/dummy/app/views/articles/new.html.erb +5 -0
  34. data/test/dummy/app/views/articles/show.html.erb +19 -0
  35. data/test/dummy/app/views/home/index.html.erb +2 -0
  36. data/test/dummy/app/views/home/privacy.html.erb +2 -0
  37. data/test/dummy/app/views/home/tos.html.erb +2 -0
  38. data/test/dummy/app/views/layouts/application.html.erb +13 -0
  39. data/test/dummy/bin/bundle +3 -0
  40. data/test/dummy/bin/rails +4 -0
  41. data/test/dummy/bin/rake +4 -0
  42. data/test/dummy/bin/setup +29 -0
  43. data/test/dummy/config.ru +4 -0
  44. data/test/dummy/config/application.rb +26 -0
  45. data/test/dummy/config/boot.rb +5 -0
  46. data/test/dummy/config/database.yml +25 -0
  47. data/test/dummy/config/environment.rb +5 -0
  48. data/test/dummy/config/environments/development.rb +41 -0
  49. data/test/dummy/config/environments/production.rb +79 -0
  50. data/test/dummy/config/environments/test.rb +42 -0
  51. data/test/dummy/config/initializers/assets.rb +11 -0
  52. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  53. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  54. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  55. data/test/dummy/config/initializers/inflections.rb +16 -0
  56. data/test/dummy/config/initializers/mime_types.rb +4 -0
  57. data/test/dummy/config/initializers/open_ssl.rb +6 -0
  58. data/test/dummy/config/initializers/roguelytics.rb +12 -0
  59. data/test/dummy/config/initializers/roguelytics_development.rb +1 -0
  60. data/test/dummy/config/initializers/session_store.rb +3 -0
  61. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  62. data/test/dummy/config/locales/en.yml +23 -0
  63. data/test/dummy/config/routes.rb +64 -0
  64. data/test/dummy/config/secrets.yml +22 -0
  65. data/test/dummy/db/development.sqlite3 +0 -0
  66. data/test/dummy/db/migrate/20170804171300_create_blog_entries.rb +9 -0
  67. data/test/dummy/db/migrate/20170913124931_create_articles.rb +11 -0
  68. data/test/dummy/db/schema.rb +30 -0
  69. data/test/dummy/log/development.log +416 -0
  70. data/test/dummy/public/404.html +67 -0
  71. data/test/dummy/public/422.html +67 -0
  72. data/test/dummy/public/500.html +66 -0
  73. data/test/dummy/public/favicon.ico +0 -0
  74. data/test/dummy/test/controllers/articles_controller_test.rb +49 -0
  75. data/test/dummy/test/controllers/home_controller_test.rb +19 -0
  76. data/test/dummy/test/fixtures/articles.yml +11 -0
  77. data/test/dummy/test/fixtures/blog_entries.yml +7 -0
  78. data/test/dummy/test/models/article_test.rb +7 -0
  79. data/test/dummy/test/models/blog_entry_test.rb +7 -0
  80. data/test/dummy/tmp/cache/assets/sprockets/v3.0/4L/4LynumPhGImyZEfA6U3FIkfoZfFnLcL1SbwIGx83-rA.cache +1 -0
  81. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5L/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +0 -0
  82. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5t/5tjLh_pMC2cgtscThIUHDcKUjyXwS_0Jcn77DivbR7M.cache +1 -0
  83. data/test/dummy/tmp/cache/assets/sprockets/v3.0/6n/6nC7m65CDSZda2vqCYmqVeuHCmFMYUInoctoQEn7xLQ.cache +0 -0
  84. data/test/dummy/tmp/cache/assets/sprockets/v3.0/6y/6yuZaeKOE55DaRca8vmQ3YBnovpu12aT8_HhsxFbDe4.cache +1 -0
  85. data/test/dummy/tmp/cache/assets/sprockets/v3.0/77/77T3hTbilbTh2Gr6PefkFFkyPM_VyepLpP5IMqZLnyE.cache +1 -0
  86. data/test/dummy/tmp/cache/assets/sprockets/v3.0/78/78l_FH3y4OPecqJmP2WiiWF40zm0ZawcGaTqNWdyccc.cache +1 -0
  87. data/test/dummy/tmp/cache/assets/sprockets/v3.0/7t/7tIZ1FJPIr2PW817HCDZIIPYI7X9d8SqA8yCMLAuRNE.cache +0 -0
  88. data/test/dummy/tmp/cache/assets/sprockets/v3.0/8y/8yLeClTWUGeGKjD18dVKODiHkAjPvTb8bclY5uxTuQw.cache +0 -0
  89. data/test/dummy/tmp/cache/assets/sprockets/v3.0/CV/CVZtqRb-gUyegEZQ88RjKazlUpgf-niazbJuyM7Dtos.cache +0 -0
  90. data/test/dummy/tmp/cache/assets/sprockets/v3.0/DS/DSOLSc6A5RVSmvM415eEWAWG_AgOvZcLZOXQjsXyWQA.cache +0 -0
  91. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Dm/DmmfrCpXtt74Hr6NO54lxyOCDv6klnDyBqeDFR7oDU8.cache +3 -0
  92. data/test/dummy/tmp/cache/assets/sprockets/v3.0/GX/GXial7jvIUcw07yf8-CbhPnez1AqCX9p4Qb6zS3AUOM.cache +1 -0
  93. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Jw/JwApFqyhX5cmzEVGd88Ih1EzW-q2R5pLmm-9eGR0iKM.cache +1 -0
  94. data/test/dummy/tmp/cache/assets/sprockets/v3.0/K3/K3Wtyv6B4kcvv4cV6npe3FOxogninIOZuzLj5zBK4r0.cache +0 -0
  95. data/test/dummy/tmp/cache/assets/sprockets/v3.0/KT/KTtrZuiLccu9JEw3HCSF_DJtmW7ozUU2u0mKPwi-r9Q.cache +1 -0
  96. data/test/dummy/tmp/cache/assets/sprockets/v3.0/OI/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +0 -0
  97. data/test/dummy/tmp/cache/assets/sprockets/v3.0/TK/TKCykohX35ESwG9jfAvrn38I7aQMBg1DEqwVxeStqno.cache +1 -0
  98. data/test/dummy/tmp/cache/assets/sprockets/v3.0/TS/TSaNweQLB5rFtYGYLfEUCIof1fcj3no6-Ntpujc0qCs.cache +1 -0
  99. data/test/dummy/tmp/cache/assets/sprockets/v3.0/U8/U896CpAmtjYLXPbZH-etjUjey6IX8hT4PfTf-rFgNLM.cache +1 -0
  100. data/test/dummy/tmp/cache/assets/sprockets/v3.0/VK/VKPSHWFOchv3g7uSjw_xiO6VJhAVoctBXWptKQBXr7Q.cache +1 -0
  101. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Vy/VywdsNCae1Pv1itGAsmV04sOancpx9qScldUXLYBq10.cache +0 -0
  102. data/test/dummy/tmp/cache/assets/sprockets/v3.0/WH/WHG_jjrANZ1AHyrMh0xhaqWvPmHr4HGQykPm5M26Tg4.cache +1 -0
  103. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Y2/Y2xRue6VMfxd-PxRTUln08vx0lE4AWhXPgrC5ib_MfU.cache +1 -0
  104. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ZW/ZWBPt0raH0103Rv-8dyO-EdjKcShQajoPNhxl_ue7vM.cache +1 -0
  105. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ZX/ZX8FAgdGs0tjaWJY6_RfA3BqGWFoq10a1suS84EaMho.cache +1 -0
  106. data/test/dummy/tmp/cache/assets/sprockets/v3.0/_9/_9VINLfBHCsaDuj7Y0LxiUek4upyJKWdGq9QeTOugNg.cache +0 -0
  107. data/test/dummy/tmp/cache/assets/sprockets/v3.0/_W/_WW9fuwhim--15t30Qmjt6aa_vSZD7CCvhLKnOvvUMw.cache +0 -0
  108. data/test/dummy/tmp/cache/assets/sprockets/v3.0/aN/aNlAvipKVYqnelXDC-KqVN0LtNDSYKxasVHPTyWw0BA.cache +0 -0
  109. data/test/dummy/tmp/cache/assets/sprockets/v3.0/aw/awAzm5ad3McrRKUWPEZc3iyhsAyTo01gFH9gFdKyMu0.cache +1 -0
  110. data/test/dummy/tmp/cache/assets/sprockets/v3.0/cr/crCffUpTbvlfRQ6wTb-RDr2dmygTfczFeTZX9hKc-sA.cache +0 -0
  111. data/test/dummy/tmp/cache/assets/sprockets/v3.0/dp/dphXxQV1ZyMzvKy0tXw9loofG0G8_4MC_ZXSE_eHnFI.cache +3 -0
  112. data/test/dummy/tmp/cache/assets/sprockets/v3.0/gZ/gZp3uXMHuYQC4hzCr7bQfetKNdJAtbQmg3so2KpW1Dw.cache +0 -0
  113. data/test/dummy/tmp/cache/assets/sprockets/v3.0/gp/gp17QKBSZmfLAfRYGMN8yk_7d4dqHaYN5rlFrxLzQds.cache +1 -0
  114. data/test/dummy/tmp/cache/assets/sprockets/v3.0/hZ/hZi1k6tpxxCGYxRe7zY74ItcOI8gZrREOpGuA8JSpGg.cache +0 -0
  115. data/test/dummy/tmp/cache/assets/sprockets/v3.0/hg/hg-FVNsu_bM1RdvRY-e-yO0N2fnCrgNqeUcrtMJHzKQ.cache +0 -0
  116. data/test/dummy/tmp/cache/assets/sprockets/v3.0/io/ioHbckxnIq6atuSwOpGbiZGjHoNXhp5tyvz7_Q_rcQ4.cache +0 -0
  117. data/test/dummy/tmp/cache/assets/sprockets/v3.0/kI/kI-DVMwpXxQkH59BV8NH0eKbXuLoUyTAXBVo6ubfTP0.cache +1 -0
  118. data/test/dummy/tmp/cache/assets/sprockets/v3.0/oJ/oJw4yrcbWy7KDZHAOmS73_nsu-zI_MpP56Q4gUHcLH4.cache +0 -0
  119. data/test/dummy/tmp/cache/assets/sprockets/v3.0/oM/oM65xG-hzxkvaj8o3qrdlvNdqS1HIOnTPMdBrSqjRYg.cache +0 -0
  120. data/test/dummy/tmp/cache/assets/sprockets/v3.0/oN/oNJ82jQLgSgC2iCRCvZZRkZWYpNpTTWnL7cxJtzvAsM.cache +1 -0
  121. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pE/pEhaat2KBd5SrT7szC_8R1_6hK17FTpvoRFkmCRSD3M.cache +0 -0
  122. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pn/pnW3u_1AN48ig6ngefI89y96xoSlvnJurx-e3J-leoE.cache +3 -0
  123. data/test/dummy/tmp/cache/assets/sprockets/v3.0/po/pob7NeX_d1gazFzmZgbaxgbMBgm2xukQXsnT4AAidF4.cache +2 -0
  124. data/test/dummy/tmp/cache/assets/sprockets/v3.0/q_/q_C4VxlOyuD-0BcshE8ppieNFt91q5bPDqMAJkcX0BM.cache +1 -0
  125. data/test/dummy/tmp/cache/assets/sprockets/v3.0/r2/r2dF1Q4lkbjwbEl3icYtudpb22IhLM_D3h-A2LOEd94.cache +0 -0
  126. data/test/dummy/tmp/cache/assets/sprockets/v3.0/sl/slJgR4NtLHSGcyMxTe6EBHGKNdAMFkZteOS3jY8nxpY.cache +1 -0
  127. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ss/ssS2x0Wl67rwXHaVHsh6CO7ayn9fQ5saIwATKN6O-nI.cache +3 -0
  128. data/test/dummy/tmp/cache/assets/sprockets/v3.0/up/upLda7fecY7vaRYUsh2R-1gG0qlL6rpIADDsiv0Dx8g.cache +1 -0
  129. data/test/dummy/tmp/cache/assets/sprockets/v3.0/vt/vtDLGYnFbmmIYbmlsmIlvdkWj4Il2EC2L1v6PVsqLAk.cache +0 -0
  130. data/test/dummy/tmp/cache/assets/sprockets/v3.0/w3/w3wvndAq2nzqGKG595Wp3ryAejWeBc_mRnb1paFuB5g.cache +1 -0
  131. data/test/dummy/tmp/cache/assets/sprockets/v3.0/wG/wG_whueNWUbRh4wvgMhX2f7EtoDSqX1y_OwF9RgjLvc.cache +3 -0
  132. data/test/dummy/tmp/cache/assets/sprockets/v3.0/xD/xDxvSfz9i2TZ9-gpCFwn6kRoCqjI0wWSuE3P48gVeMM.cache +1 -0
  133. data/test/dummy/tmp/cache/assets/sprockets/v3.0/yK/yKqxraS3nt2NddTBgmN1IcDcsG5lnoyESZFhfAtbyH4.cache +1 -0
  134. data/test/dummy/tmp/cache/assets/sprockets/v3.0/yt/ytwJh9r_yOESGjxxTYLOCxXSt4aW1fYwQVcVdH4ESbM.cache +2 -0
  135. data/test/dummy/tmp/cache/assets/sprockets/v3.0/zh/zh1n5zAZSyHWdEk-DUmtEYj1wFlVigyybsPLGE3Xah0.cache +0 -0
  136. data/test/roguelytics_test.rb +7 -0
  137. data/test/test_helper.rb +19 -0
  138. metadata +348 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 578d795eb8ad254ff82c0dd597f24704a37562a4
4
+ data.tar.gz: ef8c87991d56db2fbb84449d7040e4f7c66bb0f3
5
+ SHA512:
6
+ metadata.gz: c0d9afa96416f16231bccf2fe11d76e92447b7730080d9d2b210d7ee0fe84526e5a5998500f29bdc586aad6c6331267c002212e03324efbd9151c8a6d403a591
7
+ data.tar.gz: 529f6799a1045bf3c4086d8a5154547fb9eec96219a8cfd95690b1d39fe799ba2be2412fd0c685f9f250b2340ad9128f9d12a57cc3ae9fa9bc34db7e62b75320
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2017 Rogue Studios, LLC.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,34 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Roguelytics'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+
20
+
21
+
22
+ Bundler::GemHelper.install_tasks
23
+
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'lib'
28
+ t.libs << 'test'
29
+ t.pattern = 'test/**/*_test.rb'
30
+ t.verbose = false
31
+ end
32
+
33
+
34
+ task default: :test
@@ -0,0 +1,22 @@
1
+ module Devise
2
+ module Generators
3
+ class RoguelyticsGenerator < Rails::Generators::Base
4
+
5
+ namespace "roguelytics"
6
+ desc "This generator creates an initializer file at config/initializers for Roguelytics"
7
+
8
+ def create_initializer_file
9
+ create_file "config/initializers/roguelytics.rb", "
10
+ #
11
+ # Roguelytics Initializer
12
+ #
13
+ ROGUELYTICS_SITEKEY = '' if Rails.env.production?
14
+ ROGUELYTICS_SITEKEY = '' if Rails.env.staging?
15
+ ROGUELYTICS_SITEKEY = '' if Rails.env.development?
16
+ ROGUELYTICS_SITEKEY = '' if Rails.env.qa?
17
+ ROGUELYTICS_SITEKEY = '' if Rails.env.test?
18
+ "
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,24 @@
1
+ require 'rails/generators'
2
+
3
+ module Roguelytics
4
+ class InitializerGenerator < Rails::Generators::Base
5
+
6
+ source_root File.expand_path("../templates", __FILE__)
7
+
8
+ namespace "roguelytics"
9
+ desc "This generator creates an initializer file at config/initializers for Roguelytics"
10
+
11
+ def create_initializer_file
12
+ create_file "config/initializers/roguelytics.rb", "
13
+ #
14
+ # Roguelytics Initializer
15
+ #
16
+ ROGUELYTICS_SITEKEY = '' if Rails.env.production?
17
+ ROGUELYTICS_SITEKEY = '' if Rails.env.staging?
18
+ ROGUELYTICS_SITEKEY = '' if Rails.env.development?
19
+ ROGUELYTICS_SITEKEY = '' if Rails.env.qa?
20
+ ROGUELYTICS_SITEKEY = '' if Rails.env.test?
21
+ "
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,7 @@
1
+
2
+ require 'roguelytics/has_roguelytics'
3
+ require 'roguelytics/process_job'
4
+ require 'roguelytics/railtie' if defined?(Rails)
5
+
6
+ module Roguelytics
7
+ end
@@ -0,0 +1,56 @@
1
+
2
+ module Roguelytics
3
+ module HasRoguelytics
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ end
8
+
9
+ private
10
+
11
+ module ClassMethods
12
+ def has_roguelytics
13
+ include Roguelytics::HasRoguelytics::LocalInstanceMethods
14
+ if self.respond_to?(:after_commit)
15
+ self.send(:after_commit, on: :create) do
16
+ self.roguelytics_create
17
+ end
18
+ self.send(:after_commit, on: :update) do
19
+ self.roguelytics_update
20
+ end
21
+ self..send(:after_commit, on: :destroy) do
22
+ self.roguelytics_destroy
23
+ end
24
+ true
25
+ end
26
+ true
27
+ end
28
+ end
29
+
30
+ module LocalInstanceMethods
31
+ def roguelytics_get event, params
32
+ if Rails.env.development?
33
+ Roguelytics::ProcessJob.perform_now event, params
34
+ else
35
+ Roguelytics::ProcessJob.perform_later event, params
36
+ end
37
+ end
38
+
39
+ def roguelytics_params
40
+ params = { model_name: self.class.to_s, id: self.id, created_at: "#{self.created_at.to_s}", name: (self.name rescue nil) }
41
+ end
42
+
43
+ def roguelytics_create
44
+ self.roguelytics_get 'create', roguelytics_params
45
+ end
46
+
47
+ def roguelytics_update
48
+ self.roguelytics_get 'update', roguelytics_params
49
+ end
50
+
51
+ def roguelytics_delete
52
+ self.roguelytics_get 'delete', roguelytics_params
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,36 @@
1
+
2
+ require "active_job"
3
+
4
+ module Roguelytics
5
+ class ProcessJob < ActiveJob::Base
6
+ queue_as :default
7
+
8
+ def perform(event,params)
9
+
10
+ params[:sitekey] = ROGUELYTICS_SITEKEY
11
+
12
+ url_base = "https://www.roguelytics.com"
13
+
14
+ if event == 'create'
15
+ url = "#{url_base}/api/v1/site_event/create.json"
16
+ elsif event == 'update'
17
+ url = "#{url_base}/api/v1/site_event/update.json"
18
+ elsif event == 'delete'
19
+ url = "#{url_base}/api/v1/site_event/delete.json"
20
+ else
21
+ raise "unknown event:#{event}"
22
+ return
23
+ end
24
+
25
+ #begin
26
+ uri = URI url
27
+ uri.query = URI.encode_www_form(params)
28
+ res = Net::HTTP.get_response(uri)
29
+ puts res.body if res.is_a?(Net::HTTPSuccess)
30
+ #rescue
31
+ #end
32
+
33
+ true
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,8 @@
1
+ require 'roguelytics/view_helpers'
2
+ module Roguelytics
3
+ class Railtie < Rails::Railtie
4
+ initializer "roguelytics.view_helpers" do
5
+ ActionView::Base.send :include, ViewHelpers
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ module Roguelytics
2
+ VERSION = "1.0.13"
3
+ end
@@ -0,0 +1,7 @@
1
+ module Roguelytics
2
+ module ViewHelpers
3
+ def roguelytics
4
+ raw "<div id='roguelytics'></div><script src='https://www.roguelytics.com/js/v1/roguelytics.js?sitekey=#{ROGUELYTICS_SITEKEY}'></script>"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :roguelytics do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,56 @@
1
+ body { background-color: #fff; color: #333; }
2
+
3
+ body, p, ol, ul, td {
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ pre {
10
+ background-color: #eee;
11
+ padding: 10px;
12
+ font-size: 11px;
13
+ }
14
+
15
+ a { color: #000; }
16
+ a:visited { color: #666; }
17
+ a:hover { color: #fff; background-color:#000; }
18
+
19
+ div.field, div.actions {
20
+ margin-bottom: 10px;
21
+ }
22
+
23
+ #notice {
24
+ color: green;
25
+ }
26
+
27
+ .field_with_errors {
28
+ padding: 2px;
29
+ background-color: red;
30
+ display: table;
31
+ }
32
+
33
+ #error_explanation {
34
+ width: 450px;
35
+ border: 2px solid red;
36
+ padding: 7px;
37
+ padding-bottom: 0;
38
+ margin-bottom: 20px;
39
+ background-color: #f0f0f0;
40
+ }
41
+
42
+ #error_explanation h2 {
43
+ text-align: left;
44
+ font-weight: bold;
45
+ padding: 5px 5px 5px 15px;
46
+ font-size: 12px;
47
+ margin: -7px;
48
+ margin-bottom: 0px;
49
+ background-color: #c00;
50
+ color: #fff;
51
+ }
52
+
53
+ #error_explanation ul li {
54
+ font-size: 12px;
55
+ list-style: square;
56
+ }
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
@@ -0,0 +1,58 @@
1
+ class ArticlesController < ApplicationController
2
+ before_action :set_article, only: [:show, :edit, :update, :destroy]
3
+
4
+ # GET /articles
5
+ def index
6
+ @articles = Article.all
7
+ end
8
+
9
+ # GET /articles/1
10
+ def show
11
+ end
12
+
13
+ # GET /articles/new
14
+ def new
15
+ @article = Article.new
16
+ end
17
+
18
+ # GET /articles/1/edit
19
+ def edit
20
+ end
21
+
22
+ # POST /articles
23
+ def create
24
+ @article = Article.new(article_params)
25
+
26
+ if @article.save
27
+ redirect_to @article, notice: 'Article was successfully created.'
28
+ else
29
+ render :new
30
+ end
31
+ end
32
+
33
+ # PATCH/PUT /articles/1
34
+ def update
35
+ if @article.update(article_params)
36
+ redirect_to @article, notice: 'Article was successfully updated.'
37
+ else
38
+ render :edit
39
+ end
40
+ end
41
+
42
+ # DELETE /articles/1
43
+ def destroy
44
+ @article.destroy
45
+ redirect_to articles_url, notice: 'Article was successfully destroyed.'
46
+ end
47
+
48
+ private
49
+ # Use callbacks to share common setup or constraints between actions.
50
+ def set_article
51
+ @article = Article.find(params[:id])
52
+ end
53
+
54
+ # Only allow a trusted parameter "white list" through.
55
+ def article_params
56
+ params.require(:article).permit(:name, :author, :content)
57
+ end
58
+ end