bookingsync_application 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b39192f6bd1518078417529440dac15a6c4b6a18
4
+ data.tar.gz: 86d6f5097782e172571874351a6848701503fe9c
5
+ SHA512:
6
+ metadata.gz: 76327b3f1fea2f9a968dfa090c4bdf8b6ddd4371cdc7dd7400702276176f548243824249b3c732fa63dff7e20852301e546faaf4860ba982bb76afffb4cc656f
7
+ data.tar.gz: 69f554a1697925848abbbc4eb1ce08ca04f12897202f69ff9b668851199b7e2b905a105402a35b5db05423ba53dad16c63df522b37c26646c75bddfb152d1b2b
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2015 Piotr Marciniak
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/README.md ADDED
@@ -0,0 +1,30 @@
1
+ [![Build Status](https://travis-ci.org/BookingSync/bookingsync_application.svg?branch=master)](https://travis-ci.org/BookingSync/bookingsync-engine)
2
+
3
+ # BookingsyncApplication
4
+
5
+ A Rails engine to simplify building BookingSync Applications.
6
+
7
+ # Usage
8
+
9
+ * add bookingsync_application to your gemfile
10
+ ```
11
+ gem 'bookingsync_application'
12
+ ```
13
+ * add to rails_helper (before spec/support inclusion):
14
+ ```
15
+ require 'bookingsync_application/spec_helper'
16
+ ```
17
+ * create base admin controller (it will be json based):
18
+ ```
19
+ class Admin::BaseController < BookingsyncApplication::Admin::BaseController
20
+ end
21
+ ```
22
+ * optionally if you want to have html based controller:
23
+ ```
24
+ class Admin::BaseHTMLController < ApplicationController
25
+ respond_to :html
26
+
27
+ include BookingsyncApplication::CommonBaseController
28
+ end
29
+ ```
30
+ * BookingsyncEngine is a dependency here. Follow steps in https://github.com/BookingSync/bookingsync-engine
data/Rakefile ADDED
@@ -0,0 +1,31 @@
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
+ require 'thor'
9
+
10
+ RDoc::Task.new(:rdoc) do |rdoc|
11
+ rdoc.rdoc_dir = 'rdoc'
12
+ rdoc.title = 'BookingsyncApplication'
13
+ rdoc.options << '--line-numbers'
14
+ rdoc.rdoc_files.include('README.m')
15
+ rdoc.rdoc_files.include('lib/**/*.rb')
16
+ end
17
+
18
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
19
+ load 'rails/tasks/engine.rake'
20
+
21
+
22
+ Bundler::GemHelper.install_tasks
23
+
24
+
25
+ require 'rspec/core'
26
+ require 'rspec/core/rake_task'
27
+
28
+ desc "Run all specs in spec directory (excluding plugin specs)"
29
+ RSpec::Core::RakeTask.new(:spec => 'app:db:test:prepare')
30
+
31
+ task default: :spec
@@ -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/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -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,18 @@
1
+ require 'jsonapi/resource_controller'
2
+ require 'bookingsync_application/common_base_controller'
3
+
4
+ class BookingsyncApplication::Admin::BaseController < JSONAPI::ResourceController
5
+ respond_to :json
6
+
7
+ before_action :set_json_format
8
+
9
+ include BookingsyncApplication::CommonBaseController
10
+
11
+ private
12
+
13
+ def set_json_format
14
+ if params[:format].blank?
15
+ request.format = :json
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,4 @@
1
+ module BookingsyncApplication
2
+ class ApplicationController < BookingsyncApplication.master_controller_class
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module BookingsyncApplicationEngine
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>BookingsyncApplicationEngine</title>
5
+ <%= stylesheet_link_tag "bookingsync_application_engine/application", media: "all" %>
6
+ <%= javascript_include_tag "bookingsync_application_engine/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ BookingsyncApplication::Engine.routes.draw do
2
+ end
@@ -0,0 +1,14 @@
1
+ module BookingsyncApplication::CommonBaseController
2
+ def self.included(base)
3
+ base.class_eval do
4
+ force_ssl
5
+
6
+ before_action :authenticate_account!
7
+ after_action :allow_bookingsync_iframe
8
+ end
9
+ end
10
+
11
+ def context
12
+ { current_account: current_account }
13
+ end
14
+ end
@@ -0,0 +1,10 @@
1
+ module BookingsyncApplication
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace BookingsyncApplication
4
+
5
+ config.generators do |g|
6
+ g.test_framework :rspec
7
+ g.fixture_replacement :factory_girl, dir: 'spec/factories'
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,21 @@
1
+ shared_examples_for :synced_model do
2
+ describe ".included_modules" do
3
+ subject { described_class.included_modules }
4
+
5
+ it { is_expected.to include Synced::HasSyncedData }
6
+ end
7
+ end
8
+
9
+ require 'vcr'
10
+
11
+ VCR.configure do |config|
12
+ config.cassette_library_dir = "spec/fixtures/cassettes"
13
+ config.hook_into :webmock
14
+ config.configure_rspec_metadata!
15
+ config.filter_sensitive_data('Bearer <OAUTH_TOKEN>') do |interaction|
16
+ if interaction.request.headers['Authorization']
17
+ interaction.request.headers['Authorization'].first
18
+ end
19
+ end
20
+ config.ignore_hosts 'codeclimate.com'
21
+ end
@@ -0,0 +1,3 @@
1
+ module BookingsyncApplication
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,15 @@
1
+ require "bookingsync"
2
+ require "jsonapi-resources"
3
+ require "bookingsync_application/engine"
4
+
5
+ module BookingsyncApplication
6
+ mattr_accessor :master_controller_class
7
+
8
+ def self.master_controller_class
9
+ if @@master_controller_class
10
+ @@master_controller_class.constantize
11
+ else
12
+ ApplicationController
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :bookingsync_application do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,188 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bookingsync_application
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Marcin Nowicki
8
+ - Mariusz Pietrzyk
9
+ - Piotr Marciniak
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2015-02-19 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rails
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - "~>"
20
+ - !ruby/object:Gem::Version
21
+ version: 4.1.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - "~>"
27
+ - !ruby/object:Gem::Version
28
+ version: 4.1.0
29
+ - !ruby/object:Gem::Dependency
30
+ name: bookingsync-engine
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: 0.4.6
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: 0.4.6
43
+ - !ruby/object:Gem::Dependency
44
+ name: jsonapi-resources
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ - !ruby/object:Gem::Dependency
58
+ name: rspec-rails
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ type: :runtime
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ - !ruby/object:Gem::Dependency
72
+ name: factory_girl_rails
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ type: :runtime
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ - !ruby/object:Gem::Dependency
86
+ name: synced
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ type: :runtime
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ - !ruby/object:Gem::Dependency
100
+ name: sqlite3
101
+ requirement: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ type: :development
107
+ prerelease: false
108
+ version_requirements: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ - !ruby/object:Gem::Dependency
114
+ name: vcr
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ type: :development
121
+ prerelease: false
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ - !ruby/object:Gem::Dependency
128
+ name: webmock
129
+ requirement: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ version: '0'
141
+ description: A Rails engine to simplify building BookingSync Applications
142
+ email:
143
+ - dev@bookingsync.com
144
+ executables: []
145
+ extensions: []
146
+ extra_rdoc_files: []
147
+ files:
148
+ - MIT-LICENSE
149
+ - README.md
150
+ - Rakefile
151
+ - app/assets/javascripts/bookingsync_application/application.js
152
+ - app/assets/stylesheets/bookingsync_application/application.css
153
+ - app/controllers/bookingsync_application/admin/base_controller.rb
154
+ - app/controllers/bookingsync_application/application_controller.rb
155
+ - app/helpers/bookingsync_application/application_helper.rb
156
+ - app/views/layouts/bookingsync_application/application.html.erb
157
+ - config/routes.rb
158
+ - lib/bookingsync_application.rb
159
+ - lib/bookingsync_application/common_base_controller.rb
160
+ - lib/bookingsync_application/engine.rb
161
+ - lib/bookingsync_application/spec_helper.rb
162
+ - lib/bookingsync_application/version.rb
163
+ - lib/tasks/bookingsync_application_tasks.rake
164
+ homepage: https://github.com/BookingSync/bookingsync_application
165
+ licenses:
166
+ - MIT
167
+ metadata: {}
168
+ post_install_message:
169
+ rdoc_options: []
170
+ require_paths:
171
+ - lib
172
+ required_ruby_version: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - ">="
175
+ - !ruby/object:Gem::Version
176
+ version: '0'
177
+ required_rubygems_version: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - ">="
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ requirements: []
183
+ rubyforge_project:
184
+ rubygems_version: 2.2.2
185
+ signing_key:
186
+ specification_version: 4
187
+ summary: A Rails engine to simplify building BookingSync Applications
188
+ test_files: []