zoho_reports 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +79 -0
  6. data/Rakefile +8 -0
  7. data/lib/zoho_reports/client.rb +245 -0
  8. data/lib/zoho_reports/configuration.rb +11 -0
  9. data/lib/zoho_reports/version.rb +3 -0
  10. data/lib/zoho_reports/zoho_reportify.rb +53 -0
  11. data/lib/zoho_reports.rb +16 -0
  12. data/spec/dummy/.rspec +1 -0
  13. data/spec/dummy/README.rdoc +28 -0
  14. data/spec/dummy/Rakefile +6 -0
  15. data/spec/dummy/app/assets/images/.keep +0 -0
  16. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  17. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  18. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  19. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  20. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  21. data/spec/dummy/app/mailers/.keep +0 -0
  22. data/spec/dummy/app/models/.keep +0 -0
  23. data/spec/dummy/app/models/concerns/.keep +0 -0
  24. data/spec/dummy/app/models/widget.rb +3 -0
  25. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  26. data/spec/dummy/bin/bundle +3 -0
  27. data/spec/dummy/bin/rails +4 -0
  28. data/spec/dummy/bin/rake +4 -0
  29. data/spec/dummy/config/application.rb +28 -0
  30. data/spec/dummy/config/boot.rb +5 -0
  31. data/spec/dummy/config/database.yml +25 -0
  32. data/spec/dummy/config/environment.rb +5 -0
  33. data/spec/dummy/config/environments/development.rb +29 -0
  34. data/spec/dummy/config/environments/production.rb +80 -0
  35. data/spec/dummy/config/environments/test.rb +36 -0
  36. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  37. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  38. data/spec/dummy/config/initializers/inflections.rb +16 -0
  39. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  40. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  41. data/spec/dummy/config/initializers/session_store.rb +3 -0
  42. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  43. data/spec/dummy/config/locales/en.yml +23 -0
  44. data/spec/dummy/config/routes.rb +56 -0
  45. data/spec/dummy/config.ru +4 -0
  46. data/spec/dummy/db/development.sqlite3 +0 -0
  47. data/spec/dummy/db/migrate/20140418123137_create_widgets.rb +10 -0
  48. data/spec/dummy/db/schema.rb +23 -0
  49. data/spec/dummy/db/test.sqlite3 +0 -0
  50. data/spec/dummy/lib/assets/.keep +0 -0
  51. data/spec/dummy/log/.keep +0 -0
  52. data/spec/dummy/log/development.log +45 -0
  53. data/spec/dummy/log/test.log +3539 -0
  54. data/spec/dummy/public/404.html +58 -0
  55. data/spec/dummy/public/422.html +58 -0
  56. data/spec/dummy/public/500.html +57 -0
  57. data/spec/dummy/public/favicon.ico +0 -0
  58. data/spec/fixtures/add_row.json +22 -0
  59. data/spec/fixtures/import.json +23 -0
  60. data/spec/fixtures/update.json +16 -0
  61. data/spec/spec_helper.rb +72 -0
  62. data/spec/zoho_reports/client_spec.rb +170 -0
  63. data/spec/zoho_reports/configuration_spec.rb +19 -0
  64. data/spec/zoho_reports/zoho_reportify_spec.rb +73 -0
  65. data/spec/zoho_reports_spec.rb +18 -0
  66. data/zoho_reports.gemspec +31 -0
  67. metadata +306 -0
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ODFiZDdmMmJhNjc3NTRhOTRiNDI5YTYyMWZlMWE5NWM2YjdmMGE4OQ==
5
+ data.tar.gz: !binary |-
6
+ NGQ1MTk5NmYxNTUwOTNjYmJjMDQ1YjQ2NDU1Mjk0OTZmMjcwNGQzMg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZDA5OGZjYzQyNzM1YzA0NDI5MzczYTFjYjY5YTM1MWE2NmQ4YWNjNmI2YzBk
10
+ YWMzNzVmNmFhNmZhYmVjZjgxOTNkMmNmOThiOTA0ZTZkY2E3NmFlNjg3MWM3
11
+ NGNlMDEzMTMxNGE3YmNjYjIwNTg5NGEzYzg2Y2Q5Nzc5OWFkNDg=
12
+ data.tar.gz: !binary |-
13
+ Y2EwYTgzNGY0NTM2ZWUyNzk3ZmNiMzQ5NDk0MTQwMTA1ZjI4MjY3NGE1ZTU3
14
+ NzRmNGU1ZjMyMGY0OWY2NzBlOTMyNDUyZDNlNThmMmVjMzUwODMwMTM4YWQ1
15
+ NzRmMzlhNWFiNTA3NDg4MjljZTIyY2YyNTMwMzZiOGI5OGFlMDg=
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in zoho_reports.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 neil
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,79 @@
1
+ # ZohoReports
2
+
3
+ Wraps the raw HTTP based API of Zoho Reports with easy to use methods for the ruby platform. This enables ruby and Rails developers to easily use Zoho Reports API.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'zoho_reports'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install zoho_reports
18
+
19
+ ## Usage
20
+
21
+ ### Setting auth_token and login_email
22
+ ```ruby
23
+ # (usually in /config/intializers/zoho_reports.rb)
24
+ ZohoReports.configure do |config|
25
+ config.auth_token = 'token'
26
+ config.login_email = 'user@example.com'
27
+ config.database_name = 'test_database'
28
+ end
29
+ ```
30
+
31
+ ### Initializing an instance
32
+ ```ruby
33
+ client = ZohoReports::Client.new
34
+ ```
35
+
36
+ ### Importing an entire model
37
+ This example shows how to import the "Widget" model records, including creating a table if it doesn't already exist.
38
+
39
+ ```ruby
40
+ # Notice the ZOHO_DATE_FORMAT here
41
+ client.import_data(
42
+ "test_database",
43
+ "widgets",
44
+ 'UPDATEADD',
45
+ Widget.all.to_json,
46
+ 'ZOHO_MATCHING_COLUMNS' => 'id',
47
+ 'ZOHO_CREATE_TABLE' => 'true',
48
+ )
49
+
50
+ ```
51
+
52
+ When importing through the API and generating a new table, string and datetime date types import correctly with format. However, here are the steps provided through the [Zoho Reports wiki comments](https://zohoreportsapi.wiki.zoho.com/importing-bulk-data.html) in case you have an issue with the column format:
53
+
54
+ 1. Login into Zoho Reports, Open the import wizard ( "Import Excel, CSV, HTML, Google docs,.." ), upload your file.
55
+ 2. Click "Next" button to go to the next screen of import wizard (i.e step 2 of 2), there you can see the preview table.
56
+ 3. In that table, the first row will be header row ( i.e., Column names ) and the second row will be the datatype which is auto identified by our Zoho Reports system. There you can change the column datatype to "Text" for the column you want to change. Then, continue the import process.
57
+
58
+ ### Rails / ActiveRecord Support
59
+ ZohoReports includes a module specific to ActiveReports that may be used as follows:
60
+
61
+ ```ruby
62
+ # /app/models/widget.rb
63
+ class Widget < ActiveRecord::Base
64
+ zoho_reportify
65
+ ...
66
+ end
67
+ ```
68
+
69
+ This adds two things to your Rails app.
70
+ 1. Widget.intialize_zoho_table will create the database table based on Widget.table_name and load all of the current data into it
71
+ 2. Adds an after_save callback that stores the instance attributes into the Zoho Reports table keeping your data in sync
72
+
73
+ ## Contributing
74
+
75
+ 1. Fork it ( http://github.com/<my-github-username>/zoho_reports/fork )
76
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
77
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
78
+ 4. Push to the branch (`git push origin my-new-feature`)
79
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ require "rspec/core/rake_task"
4
+
5
+ RSpec::Core::RakeTask.new
6
+
7
+ task :default => :spec
8
+ task :test => :spec
@@ -0,0 +1,245 @@
1
+ require "addressable/uri"
2
+ require "httmultiparty"
3
+
4
+ module ZohoReports
5
+ class Client
6
+ include HTTMultiParty
7
+
8
+ # ZohoReports provides the ruby based language binding to the http based api of ZohoReports.
9
+
10
+ attr_accessor :auth_token, :login_email, :api_version
11
+
12
+ base_uri "reportsapi.zoho.com:443/api"
13
+
14
+ def initialize
15
+ self.api_version = '1.0'
16
+ end
17
+
18
+ # Returns default settings for url query string on requests
19
+ def default_query
20
+ {
21
+ 'authtoken' => ZohoReports.configuration.auth_token,
22
+ 'ZOHO_OUTPUT_FORMAT' => 'JSON',
23
+ 'ZOHO_ERROR_FORMAT' => 'JSON',
24
+ 'ZOHO_API_VERSION' => self.api_version,
25
+ }
26
+ end
27
+
28
+ def send_request(url, http_method, options = {})
29
+ # Merge our default query string values with the specificed query values
30
+ options[:query] = default_query.merge!(options[:query])
31
+
32
+ #Convert form variables to encoded string if exists
33
+ if options.has_key?(:body)
34
+ uri = Addressable::URI.new
35
+ uri.query_values = options[:body]
36
+ options[:body] = uri.query
37
+ end
38
+
39
+ response = self.class.send(http_method,url, options)
40
+
41
+ if response.success?
42
+ response
43
+ else
44
+ raise response.parsed_response
45
+ end
46
+ end
47
+
48
+ # Gets copy database key for specified database identified by the URI
49
+ def get_copy_db_key
50
+ # payLoad = ReportClientHelper.getAsPayLoad([config],None,None)
51
+ options = {
52
+ :query => { 'ZOHO_ACTION' => 'GETCOPYDBKEY' }
53
+ }
54
+
55
+ send_request get_db_uri, 'post', options
56
+ end
57
+
58
+ # Copy the specified database identified by the URI
59
+ def copy_database
60
+ options = {
61
+ :query => { 'ZOHO_ACTION' => 'COPYDATABASE' }
62
+ }
63
+
64
+ send_request get_db_uri, 'post', options
65
+ end
66
+
67
+ # Delete the specified database
68
+ def delete_database
69
+ options = {
70
+ :query => {
71
+ 'ZOHO_ACTION' => 'DELETEDATABASE',
72
+ 'ZOHO_DATABASE_NAME' => database_name,
73
+ }
74
+ }
75
+ send_request get_user_uri, 'post', options
76
+ end
77
+
78
+ # Add the users to the Zoho Reports Account
79
+ def add_user(email_ids)
80
+ options = {
81
+ :query => {
82
+ 'ZOHO_ACTION' => 'ADDUSER',
83
+ 'ZOHO_EMAILS' => email_ids,
84
+ }
85
+ }
86
+
87
+ send_request get_user_uri, 'post', options
88
+ end
89
+
90
+ # Remove the users from the Zoho Reports Account
91
+ def remove_user(email_ids)
92
+ options = {
93
+ :query => {
94
+ 'ZOHO_ACTION' => 'REMOVEUSER',
95
+ 'ZOHO_EMAILS' => email_ids,
96
+ }
97
+ }
98
+
99
+ send_request get_user_uri, 'post', options
100
+ end
101
+
102
+ # Activate the users in the Zoho Reports Account
103
+ def activate_user(email_ids)
104
+ options = {
105
+ :query => {
106
+ 'ZOHO_ACTION' => 'ACTIVATEUSER',
107
+ 'ZOHO_EMAILS' => email_ids,
108
+ }
109
+ }
110
+
111
+ send_request get_user_uri, 'post', options
112
+ end
113
+
114
+ # Deactivate the users in the Zoho Reports Account
115
+ def deactivate_user(email_ids)
116
+ options = {
117
+ :query => {
118
+ 'ZOHO_ACTION' => 'DEACTIVATEUSER',
119
+ 'ZOHO_EMAILS' => email_ids,
120
+ }
121
+ }
122
+
123
+ send_request get_user_uri, 'post', options
124
+ end
125
+
126
+ # Adds a row to the specified table identified by the URI
127
+ def add_row(table_name, column_values)
128
+ options = {
129
+ :query => {
130
+ 'ZOHO_ACTION' => 'ADDROW',
131
+ },
132
+ :body => column_values
133
+ }
134
+
135
+ send_request get_uri(table_name), 'post', options
136
+ end
137
+
138
+ # Update the data in the specified table identified by the URI.
139
+ def update_data(table_name, column_values, criteria, config={})
140
+ body = column_values.merge!({:ZOHO_CRITERIA => criteria})
141
+ body = body.merge!(config) if config.any?
142
+
143
+ options = {
144
+ :query => {
145
+ 'ZOHO_ACTION' => 'UPDATE',
146
+ },
147
+ :body => body
148
+ }
149
+
150
+ send_request get_uri(table_name), 'post', options
151
+ end
152
+
153
+ # Delete the data in the specified table identified by the URI.
154
+ def delete_data(table_name, criteria, config={})
155
+ body = {'ZOHO_CRITERIA' => criteria}
156
+ body = body.merge!(config) if config.present?
157
+
158
+ options = {
159
+ :query => {
160
+ 'ZOHO_ACTION' => 'DELETE',
161
+ },
162
+ :body => body
163
+ }
164
+
165
+ send_request get_uri(table_name), 'post', options
166
+ end
167
+
168
+ # Export the data in the specified table identified by the URI.
169
+ def export_data(table_or_report_name, format, criteria, config={})
170
+ body = {'ZOHO_CRITERIA' => criteria}
171
+ body = body.merge!(config) if config.present?
172
+
173
+ options = {
174
+ :query => {
175
+ 'ZOHO_ACTION' => 'EXPORT',
176
+ 'ZOHO_OUTPUT_FORMAT' => format,
177
+ },
178
+ :body => body
179
+ }
180
+
181
+ result = send_request get_uri(table_or_report_name), 'post', options
182
+ result
183
+ # TODO: Figure out to what to do with File objects response
184
+ end
185
+
186
+ # Export the data with the specified SQL query identified by the URI.
187
+ def export_data_using_sql(table_or_report_uri, format, sql, config={})
188
+ body = {'ZOHO_SQLQUERY' => sql}
189
+ body = body.merge!(config) if config.present?
190
+
191
+ options = {
192
+ :query => {
193
+ 'ZOHO_ACTION' => 'EXPORT',
194
+ 'ZOHO_OUTPUT_FORMAT' => format,
195
+ },
196
+ :body => body
197
+ }
198
+
199
+ result = send_request get_uri(table_or_report_name), 'post', options
200
+ result
201
+ # TODO: Figure out to what to do with File objectsw response
202
+ end
203
+
204
+ # Bulk import data into the table identified by the URI.
205
+ def import_data(table_name, import_type, import_content, import_config={})
206
+ raise "Import Type must be APPEND, TRUNCATEADD or UPDATEADD" unless ["APPEND", "TRUNCATEADD", "UPDATEADD"].include?(import_type)
207
+
208
+ body = {
209
+ 'ZOHO_AUTO_IDENTIFY' => 'true',
210
+ 'ZOHO_ON_IMPORT_ERROR' => 'ABORT',
211
+ 'ZOHO_CREATE_TABLE' => 'false',
212
+ 'ZOHO_IMPORT_TYPE' => import_type,
213
+ 'ZOHO_IMPORT_DATA' => import_content,
214
+ 'ZOHO_IMPORT_FILETYPE' => 'JSON',
215
+ 'ZOHO_MATCHING_COLUMNS' => 'id',
216
+ }
217
+ body = body.merge!(import_config) if import_config.any?
218
+
219
+ options = {
220
+ :query => {
221
+ 'ZOHO_ACTION' => 'IMPORT',
222
+ },
223
+ :body => body
224
+ }
225
+
226
+ send_request get_uri(table_name), 'post', options
227
+ # TODO: Figure out to what to do with File objectsw response
228
+ end
229
+
230
+ # Returns the URI for the specified database table (or report).
231
+ def get_uri(table_or_report_name)
232
+ "/#{URI.encode ZohoReports.configuration.login_email}/#{URI.encode ZohoReports.configuration.zoho_database_name}/#{URI.encode table_or_report_name}"
233
+ end
234
+
235
+ # Returns the URI for the specified database
236
+ def get_db_uri
237
+ "#{URI.encode ZohoReports.configuration.login_email}/#{URI.encode ZohoReports.configuration.zoho_database_name}"
238
+ end
239
+
240
+ # Returns the URI for the specified user
241
+ def get_user_uri
242
+ "/#{URI.encode ZohoReports.configuration.login_email}"
243
+ end
244
+ end
245
+ end
@@ -0,0 +1,11 @@
1
+ module ZohoReports
2
+ class Configuration
3
+ attr_accessor :login_email, :auth_token, :zoho_database_name
4
+
5
+ def initialize
6
+ @login_email = ''
7
+ @auth_token = ''
8
+ @zoho_database_name = ''
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ module ZohoReports
2
+ VERSION = "0.0.3"
3
+ end
@@ -0,0 +1,53 @@
1
+ require 'active_support'
2
+ require 'active_support/concern'
3
+ require 'active_record'
4
+
5
+
6
+ module ZohoReports
7
+ module ZohoReportify
8
+ extend ActiveSupport::Concern
9
+
10
+ included do
11
+ end
12
+
13
+ module ClassMethods
14
+ def zoho_reportify(options = {})
15
+ after_save :save_zoho_record
16
+
17
+ def self.initialize_zoho_table
18
+ client = ZohoReports::Client.new
19
+
20
+ client.import_data(
21
+ self.table_name,
22
+ 'UPDATEADD',
23
+ all.to_json,
24
+ 'ZOHO_CREATE_TABLE' => 'true',
25
+ )
26
+ end
27
+
28
+ include ZohoReports::ZohoReportify::LocalInstanceMethods
29
+ end
30
+ end
31
+
32
+ module LocalInstanceMethods
33
+ def save_zoho_record
34
+ client = ZohoReports::Client.new
35
+
36
+ # Notice the ZOHO_DATE_FORMAT here
37
+ client.import_data(
38
+ self.class.table_name,
39
+ 'UPDATEADD',
40
+ self.class.where(id: id).to_json,
41
+ )
42
+
43
+ # Turn standard json back on
44
+
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ # Extend ActiveRecord's functionality
51
+ ActiveRecord::Base.send :include, ZohoReports::ZohoReportify
52
+
53
+ # ActiveRecord::Base.send :extend, ZohoReportify
@@ -0,0 +1,16 @@
1
+ require "zoho_reports/version"
2
+ require "zoho_reports/client"
3
+ require "zoho_reports/configuration"
4
+ require "zoho_reports/zoho_reportify"
5
+
6
+ module ZohoReports
7
+ class << self
8
+ attr_accessor :configuration
9
+ end
10
+
11
+ def self.configure
12
+ self.configuration ||= Configuration.new
13
+ yield(configuration)
14
+ end
15
+
16
+ end
data/spec/dummy/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -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
+ Dummy::Application.load_tasks
File without changes
@@ -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 vendor/assets/javascripts of plugins, if any, 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/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,13 @@
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 vendor/assets/stylesheets of plugins, if any, 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 top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -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
File without changes
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ class Widget < ActiveRecord::Base
2
+ zoho_reportify
3
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
+ <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,28 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # Pick the frameworks you want:
4
+ require "active_record/railtie"
5
+ require "action_controller/railtie"
6
+ require "action_mailer/railtie"
7
+ require "sprockets/railtie"
8
+ # require "rails/test_unit/railtie"
9
+
10
+ Bundler.require(*Rails.groups)
11
+ require "zoho_reports"
12
+
13
+ module Dummy
14
+ class Application < Rails::Application
15
+ # Settings in config/environments/* take precedence over those specified here.
16
+ # Application configuration should go into files in config/initializers
17
+ # -- all .rb files in that directory are automatically loaded.
18
+
19
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
20
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
21
+ # config.time_zone = 'Central Time (US & Canada)'
22
+
23
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
24
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
25
+ # config.i18n.default_locale = :de
26
+ end
27
+ end
28
+
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ timeout: 5000