digital_opera 0.0.10 → 0.0.12
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.
- data/.gitignore +4 -0
- data/.rspec +1 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +186 -0
- data/Guardfile +15 -0
- data/README.md +35 -0
- data/Rakefile +6 -3
- data/app/helpers/digital_opera/s3_helper.rb +14 -0
- data/digital_opera.gemspec +37 -0
- data/lib/digital_opera/banker.rb +1 -1
- data/lib/digital_opera/builders/s3_form_builder.rb +118 -0
- data/lib/digital_opera/document/base.rb +0 -0
- data/lib/digital_opera/document/fields/standard.rb +185 -0
- data/lib/digital_opera/document.rb +167 -0
- data/lib/digital_opera/engine.rb +9 -0
- data/lib/digital_opera/form_object/base.rb +115 -0
- data/lib/digital_opera/form_object.rb +13 -0
- data/lib/digital_opera/presenter/base.rb +6 -0
- data/lib/digital_opera/presenter/concerns/json_serialization.rb +30 -0
- data/lib/digital_opera/presenter.rb +9 -0
- data/lib/digital_opera/services/s3.rb +148 -0
- data/lib/digital_opera/version.rb +1 -1
- data/lib/digital_opera.rb +8 -1
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +8 -0
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +2 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.keep +0 -0
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/views/application/show.html.erb +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config/application.rb +23 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +29 -0
- data/spec/dummy/config/environments/production.rb +80 -0
- data/spec/dummy/config/environments/test.rb +36 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +12 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +16 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/public/404.html +58 -0
- data/spec/dummy/public/422.html +58 -0
- data/spec/dummy/public/500.html +57 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/spec/javascripts/helpers/.gitkeep +0 -0
- data/spec/dummy/spec/javascripts/support/jasmine.yml +116 -0
- data/spec/dummy/spec/javascripts/support/jasmine_helper.rb +10 -0
- data/spec/javascripts/spec/ellipsis_spec.js +10 -28
- data/spec/javascripts/spec/events_spec.js +15 -40
- data/spec/javascripts/spec/preload_images_spec.js +20 -32
- data/spec/javascripts/spec/tables_spec.js +3 -3
- data/spec/{banker_spec.rb → lib/digital_opera/banker_spec.rb} +4 -4
- data/spec/{base_extensions → lib/digital_opera/base_extensions}/object_spec.rb +0 -0
- data/spec/{presenter → lib/digital_opera/presenter}/base_spec.rb +0 -3
- data/spec/lib/digital_opera/services/s3_spec.rb +203 -0
- data/spec/{token_spec.rb → lib/digital_opera/token_spec.rb} +0 -0
- data/spec/spec_helper.rb +11 -5
- data/spec/support/aws.rb +5 -0
- data/spec/support/document.rb +10 -0
- data/tasks/spec.rake +5 -0
- data/tmp/rspec_guard_result +1 -0
- metadata +268 -46
- data/spec/javascripts/SpecRunner.html +0 -62
- data/spec/javascripts/lib/jasmine-1.3.1/MIT.LICENSE +0 -20
- data/spec/javascripts/lib/jasmine-1.3.1/jasmine-html.js +0 -681
- data/spec/javascripts/lib/jasmine-1.3.1/jasmine.css +0 -82
- data/spec/javascripts/lib/jasmine-1.3.1/jasmine.js +0 -2600
- data/spec/javascripts/src/digital_opera.js +0 -149
@@ -0,0 +1,167 @@
|
|
1
|
+
## Tableless models designed to work in a similar fashion to how
|
2
|
+
## a Mongoid document works
|
3
|
+
require_relative "document/fields/standard"
|
4
|
+
|
5
|
+
module DigitalOpera
|
6
|
+
module Document
|
7
|
+
extend ActiveSupport::Concern
|
8
|
+
|
9
|
+
included do
|
10
|
+
class_attribute :fields
|
11
|
+
|
12
|
+
self.fields = {}
|
13
|
+
end
|
14
|
+
|
15
|
+
def attribute_names
|
16
|
+
self.class.fields.keys.reject{ |k| !respond_to?(k) }
|
17
|
+
end
|
18
|
+
|
19
|
+
module ClassMethods
|
20
|
+
# Defines all the fields that are accessible on the Document
|
21
|
+
# For each field that is defined, a getter and setter will be
|
22
|
+
# added as an instance method to the Document.
|
23
|
+
#
|
24
|
+
# @example Define a field.
|
25
|
+
# field :score, :type => Integer, :default => 0
|
26
|
+
#
|
27
|
+
# @param [ Symbol ] name The name of the field.
|
28
|
+
# @param [ Hash ] options The options to pass to the field.
|
29
|
+
#
|
30
|
+
# @return [ Field ] The generated field
|
31
|
+
def field(name, options = {})
|
32
|
+
named = name.to_s
|
33
|
+
added = add_field(named, options)
|
34
|
+
descendants.each do |subclass|
|
35
|
+
subclass.add_field(named, options)
|
36
|
+
end
|
37
|
+
added
|
38
|
+
end
|
39
|
+
|
40
|
+
protected # -----------------------------------------
|
41
|
+
|
42
|
+
# Create the field accessors.
|
43
|
+
#
|
44
|
+
# @example Generate the accessors.
|
45
|
+
# Person.create_accessors(:name, "name")
|
46
|
+
# person.name #=> returns the field
|
47
|
+
# person.name = "" #=> sets the field
|
48
|
+
# person.name? #=> Is the field present?
|
49
|
+
# person.name_before_type_cast #=> returns the field before type cast
|
50
|
+
#
|
51
|
+
# @param [ Symbol ] name The name of the field.
|
52
|
+
# @param [ Symbol ] meth The name of the accessor.
|
53
|
+
# @param [ Hash ] options The options.
|
54
|
+
#
|
55
|
+
# @since 2.0.0
|
56
|
+
def create_accessors(name, meth, options = {})
|
57
|
+
field = fields[name]
|
58
|
+
create_field_getter(name, meth, field)
|
59
|
+
create_field_setter(name, meth, field)
|
60
|
+
end
|
61
|
+
|
62
|
+
# Create the getter method for the provided field.
|
63
|
+
#
|
64
|
+
# @example Create the getter.
|
65
|
+
# Model.create_field_getter("name", "name", field)
|
66
|
+
#
|
67
|
+
# @param [ String ] name The name of the attribute.
|
68
|
+
# @param [ String ] meth The name of the method.
|
69
|
+
# @param [ Field ] field The field.
|
70
|
+
#
|
71
|
+
# @since 2.4.0
|
72
|
+
def create_field_getter(name, meth, field)
|
73
|
+
generated_methods.module_eval do
|
74
|
+
define_method("#{ meth }") do
|
75
|
+
value = instance_variable_get "@#{ name }"
|
76
|
+
value.nil? ? field.default_val : value
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def generated_methods
|
82
|
+
@generated_methods ||= begin
|
83
|
+
mod = Module.new
|
84
|
+
include(mod)
|
85
|
+
mod
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
# Create the setter method for the provided field.
|
90
|
+
#
|
91
|
+
# @example Create the setter.
|
92
|
+
# Model.create_field_setter("name", "name")
|
93
|
+
#
|
94
|
+
# @param [ String ] name The name of the attribute.
|
95
|
+
# @param [ String ] meth The name of the method.
|
96
|
+
# @param [ Field ] field The field.
|
97
|
+
#
|
98
|
+
# @since 2.4.0
|
99
|
+
def create_field_setter(name, meth, field)
|
100
|
+
generated_methods.module_eval do
|
101
|
+
define_method("#{ meth }=") do |value|
|
102
|
+
instance_variable_set "@#{ name }", value
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
# Add the defaults to the model. This breaks them up between ones that
|
108
|
+
# are procs and ones that are not.
|
109
|
+
#
|
110
|
+
# @example Add to the defaults.
|
111
|
+
# Model.add_defaults(field)
|
112
|
+
#
|
113
|
+
# @param [ Field ] field The field to add for.
|
114
|
+
#
|
115
|
+
# @since 2.4.0
|
116
|
+
def add_defaults(field)
|
117
|
+
default, name = field.default_val, field.name.to_s
|
118
|
+
remove_defaults(name)
|
119
|
+
unless default.nil?
|
120
|
+
if field.pre_processed?
|
121
|
+
pre_processed_defaults.push(name)
|
122
|
+
else
|
123
|
+
post_processed_defaults.push(name)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
# Define a field attribute for the +Document+.
|
129
|
+
#
|
130
|
+
# @example Set the field.
|
131
|
+
# Person.add_field(:name, :default => "Test")
|
132
|
+
#
|
133
|
+
# @param [ Symbol ] name The name of the field.
|
134
|
+
# @param [ Hash ] options The hash of options.
|
135
|
+
def add_field(name, options = {})
|
136
|
+
# aliased = options[:as]
|
137
|
+
# aliased_fields[aliased.to_s] = name if aliased
|
138
|
+
field = field_for(name, options)
|
139
|
+
fields[name] = field
|
140
|
+
# add_defaults(field)
|
141
|
+
create_accessors(name, name, options)
|
142
|
+
# process_options(field)
|
143
|
+
# create_dirty_methods(name, name)
|
144
|
+
# create_dirty_methods(name, aliased) if aliased
|
145
|
+
field
|
146
|
+
end
|
147
|
+
|
148
|
+
# Remove the default keys for the provided name.
|
149
|
+
#
|
150
|
+
# @example Remove the default keys.
|
151
|
+
# Model.remove_defaults(name)
|
152
|
+
#
|
153
|
+
# @param [ String ] name The field name.
|
154
|
+
#
|
155
|
+
# @since 2.4.0
|
156
|
+
def remove_defaults(name)
|
157
|
+
pre_processed_defaults.delete_one(name)
|
158
|
+
post_processed_defaults.delete_one(name)
|
159
|
+
end
|
160
|
+
|
161
|
+
def field_for(name, options)
|
162
|
+
opts = options.merge(klass: self)
|
163
|
+
Fields::Standard.new(name, opts)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
# lib/digital_opera/form_object/base.rb
|
2
|
+
|
3
|
+
module DigitalOpera
|
4
|
+
module FormObject
|
5
|
+
class Base
|
6
|
+
# ActiveModel plumbing to make `form_for` work
|
7
|
+
extend ActiveModel::Naming
|
8
|
+
include ActiveModel::Conversion
|
9
|
+
include ActiveModel::Validations
|
10
|
+
|
11
|
+
class << self
|
12
|
+
attr_accessor :fields
|
13
|
+
end
|
14
|
+
|
15
|
+
def initialize(h={})
|
16
|
+
assign_attributes(h)
|
17
|
+
end
|
18
|
+
|
19
|
+
def persisted?
|
20
|
+
false
|
21
|
+
end
|
22
|
+
|
23
|
+
def save
|
24
|
+
if valid?
|
25
|
+
persist!
|
26
|
+
else
|
27
|
+
false
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def assign_attributes(args)
|
32
|
+
args.each do |k,v|
|
33
|
+
if respond_to?("#{k}=")
|
34
|
+
send("#{k}=", v)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def fields
|
40
|
+
self.class.ancestors.map do |a|
|
41
|
+
a.fields if a.respond_to? :fields
|
42
|
+
end.flatten.compact
|
43
|
+
end
|
44
|
+
|
45
|
+
# Class Methods ----------------------------
|
46
|
+
|
47
|
+
def self.field(*args, options)
|
48
|
+
if options.present? && !options.is_a?(Hash)
|
49
|
+
args << options
|
50
|
+
end
|
51
|
+
|
52
|
+
args.each do |field|
|
53
|
+
if options.is_a?(Hash) && options[:date] == true
|
54
|
+
date_field(field)
|
55
|
+
else
|
56
|
+
send :attr_accessor, field
|
57
|
+
end
|
58
|
+
|
59
|
+
add_to_fields field
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def self.add_to_fields(field)
|
64
|
+
@fields = @fields || []
|
65
|
+
@fields << field
|
66
|
+
end
|
67
|
+
|
68
|
+
private # ---------------------------------------------
|
69
|
+
|
70
|
+
# overwrite on subclasses
|
71
|
+
def persist!
|
72
|
+
raise NotImplementedError
|
73
|
+
end
|
74
|
+
|
75
|
+
def self.date_field(field)
|
76
|
+
# create a getter that gets the date and converts it to strftime
|
77
|
+
send :define_method, field do
|
78
|
+
if instance_variable_get("@#{field}").present?
|
79
|
+
date = instance_variable_get("@#{field}")
|
80
|
+
begin
|
81
|
+
date.strftime('%m/%d/%Y')
|
82
|
+
rescue
|
83
|
+
date
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
# setter for date
|
89
|
+
send :define_method, "#{field}=" do |date|
|
90
|
+
if date.is_a? String
|
91
|
+
begin
|
92
|
+
d = date.gsub(' ', '')
|
93
|
+
new_date = Date.parse(d)
|
94
|
+
rescue
|
95
|
+
new_date = date
|
96
|
+
end
|
97
|
+
else
|
98
|
+
new_date = date
|
99
|
+
end
|
100
|
+
|
101
|
+
instance_variable_set("@#{field}", new_date)
|
102
|
+
end
|
103
|
+
|
104
|
+
send :define_method, "valid_#{field}" do
|
105
|
+
begin
|
106
|
+
val = send(field)
|
107
|
+
val.is_a?(Date) || Date.parse(val)
|
108
|
+
rescue
|
109
|
+
errors.add(field.to_sym, 'is not a valid date')
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
## Basic building block for a FormObject that can be used to building
|
2
|
+
## intermediate form objects that can be used to execute more complex
|
3
|
+
## business logic when persisted.
|
4
|
+
##
|
5
|
+
## Recommended Use: Forms that will create multiple objects or have
|
6
|
+
## unique validation requirements.
|
7
|
+
##
|
8
|
+
require_relative 'form_object/base'
|
9
|
+
|
10
|
+
module DigitalOpera
|
11
|
+
module FormObject
|
12
|
+
end
|
13
|
+
end
|
@@ -6,6 +6,8 @@
|
|
6
6
|
module DigitalOpera
|
7
7
|
module Presenter
|
8
8
|
class Base < SimpleDelegator
|
9
|
+
include DigitalOpera::Presenter::JsonSerialization
|
10
|
+
|
9
11
|
def initialize(base, view_context=nil)
|
10
12
|
super(base)
|
11
13
|
@view_context = view_context || ActionController::Base.new.view_context
|
@@ -22,6 +24,10 @@ module DigitalOpera
|
|
22
24
|
def method_missing(sym, *args, &block)
|
23
25
|
source.send sym, *args, &block
|
24
26
|
end
|
27
|
+
|
28
|
+
def self.wrap(collection)
|
29
|
+
collection.map{ |obj| self.new(obj) }
|
30
|
+
end
|
25
31
|
end
|
26
32
|
end
|
27
33
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# lib/digital_opera/presenter/concerns/json_serialization.rb
|
2
|
+
|
3
|
+
module DigitalOpera
|
4
|
+
module Presenter
|
5
|
+
module JsonSerialization
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
def as_json(opts={})
|
9
|
+
super(opts).merge( self.get_json_field_hash )
|
10
|
+
end
|
11
|
+
|
12
|
+
def get_json_field_hash
|
13
|
+
json_field_hash = {}
|
14
|
+
|
15
|
+
self.class.include_in_json.each do |method_name|
|
16
|
+
json_field_hash[method_name.to_sym] = self.send(method_name)
|
17
|
+
end
|
18
|
+
|
19
|
+
json_field_hash
|
20
|
+
end
|
21
|
+
|
22
|
+
module ClassMethods
|
23
|
+
def include_in_json(*method_names)
|
24
|
+
return (@json_method_names || []) if method_names.empty?
|
25
|
+
@json_method_names = method_names
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,148 @@
|
|
1
|
+
|
2
|
+
## Service for handling interactions with S3
|
3
|
+
##
|
4
|
+
module DigitalOpera
|
5
|
+
module Services
|
6
|
+
class S3
|
7
|
+
def initialize(document, options={})
|
8
|
+
throw 'AWS SDK is required' if !defined?(AWS) || AWS.nil?
|
9
|
+
|
10
|
+
if document.class == String
|
11
|
+
@key = self.get_key(document)
|
12
|
+
else
|
13
|
+
@document = document
|
14
|
+
end
|
15
|
+
|
16
|
+
@options = {
|
17
|
+
acl: 'authenticated-read'
|
18
|
+
}.merge(options)
|
19
|
+
end
|
20
|
+
|
21
|
+
def document
|
22
|
+
@document
|
23
|
+
end
|
24
|
+
|
25
|
+
def base_url
|
26
|
+
"https://#{self.bucket_name}.s3.amazonaws.com/"
|
27
|
+
end
|
28
|
+
|
29
|
+
def key
|
30
|
+
@key ||= if document.s3_key.present?
|
31
|
+
self.get_key document.s3_key
|
32
|
+
else
|
33
|
+
nil
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def document_name
|
38
|
+
if key.present?
|
39
|
+
key.downcase.split('/').last
|
40
|
+
else
|
41
|
+
nil
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def public_url
|
46
|
+
if self.s3_object.present?
|
47
|
+
self.s3_object.public_url.to_s
|
48
|
+
else
|
49
|
+
nil
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def private_url
|
54
|
+
if self.s3_object.present?
|
55
|
+
disposition = "attachment; filename=#{document_name.parameterize}"
|
56
|
+
self.s3_object.url_for(:read, :expires => self.expiration(10.minutes), :response_content_disposition => disposition).to_s
|
57
|
+
else
|
58
|
+
nil
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def expiration(time=10.hours)
|
63
|
+
(time).from_now.to_time.iso8601
|
64
|
+
end
|
65
|
+
|
66
|
+
def delete
|
67
|
+
s3_object.delete
|
68
|
+
end
|
69
|
+
|
70
|
+
def policy
|
71
|
+
Base64.encode64(self.policy_data.to_json).gsub("\n", "")
|
72
|
+
end
|
73
|
+
|
74
|
+
def policy_data
|
75
|
+
{
|
76
|
+
expiration: self.expiration,
|
77
|
+
conditions: [
|
78
|
+
["starts-with", "$utf8", ""],
|
79
|
+
["starts-with", "$key", ""],
|
80
|
+
{ bucket: self.bucket_name },
|
81
|
+
{ acl: @options[:acl] }
|
82
|
+
]
|
83
|
+
}
|
84
|
+
end
|
85
|
+
|
86
|
+
def s3_object
|
87
|
+
@s3_object ||= if self.key.present?
|
88
|
+
self.bucket.objects[self.key]
|
89
|
+
else
|
90
|
+
nil
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def signature
|
95
|
+
Base64.encode64(
|
96
|
+
OpenSSL::HMAC.digest(
|
97
|
+
OpenSSL::Digest::Digest.new('sha1'),
|
98
|
+
self.secret_access_key, policy
|
99
|
+
)
|
100
|
+
).gsub("\n", "")
|
101
|
+
end
|
102
|
+
|
103
|
+
def upload_key
|
104
|
+
'documents/${filename}'
|
105
|
+
end
|
106
|
+
|
107
|
+
def bucket
|
108
|
+
::AWS::S3.new.buckets[self.bucket_name]
|
109
|
+
end
|
110
|
+
|
111
|
+
def bucket_name
|
112
|
+
self.class.bucket_name
|
113
|
+
end
|
114
|
+
|
115
|
+
def access_key
|
116
|
+
self.class.access_key
|
117
|
+
end
|
118
|
+
|
119
|
+
def secret_access_key
|
120
|
+
self.class.secret_access_key
|
121
|
+
end
|
122
|
+
|
123
|
+
def get_key(url)
|
124
|
+
if url.start_with? self.base_url
|
125
|
+
url.split(self.base_url).last
|
126
|
+
else
|
127
|
+
if url.start_with? '/'
|
128
|
+
url[1..(url.length-1)]
|
129
|
+
else
|
130
|
+
url
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
def self.bucket_name
|
136
|
+
ENV["S3_BUCKET_NAME"]
|
137
|
+
end
|
138
|
+
|
139
|
+
def self.access_key
|
140
|
+
ENV["S3_ACCESS_KEY"]
|
141
|
+
end
|
142
|
+
|
143
|
+
def self.secret_access_key
|
144
|
+
ENV["S3_SECRET_ACCESS_KEY"]
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
data/lib/digital_opera.rb
CHANGED
@@ -1,7 +1,14 @@
|
|
1
|
+
require "digital_opera/engine"
|
1
2
|
require "digital_opera/token"
|
2
3
|
require "digital_opera/base_extensions/object"
|
3
4
|
require "digital_opera/banker"
|
4
|
-
require "digital_opera/presenter
|
5
|
+
require "digital_opera/presenter"
|
6
|
+
require "digital_opera/document"
|
7
|
+
require "digital_opera/form_object"
|
8
|
+
|
9
|
+
if defined?(AWS)
|
10
|
+
require "digital_opera/services/s3"
|
11
|
+
end
|
5
12
|
|
6
13
|
module DigitalOpera
|
7
14
|
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>.
|
data/spec/dummy/Rakefile
ADDED
@@ -0,0 +1,8 @@
|
|
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
|
7
|
+
require 'jasmine'
|
8
|
+
# load 'jasmine/tasks/jasmine.rake'
|
File without changes
|
@@ -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
|
+
*/
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -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>
|
data/spec/dummy/bin/rake
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
Bundler.require(*Rails.groups)
|
6
|
+
require "digital_opera"
|
7
|
+
|
8
|
+
module Dummy
|
9
|
+
class Application < Rails::Application
|
10
|
+
# Settings in config/environments/* take precedence over those specified here.
|
11
|
+
# Application configuration should go into files in config/initializers
|
12
|
+
# -- all .rb files in that directory are automatically loaded.
|
13
|
+
|
14
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
15
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
16
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
17
|
+
|
18
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
19
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
20
|
+
# config.i18n.default_locale = :de
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|