attachy 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 +7 -0
- data/CHANGELOG.md +3 -0
- data/LICENSE +21 -0
- data/README.md +108 -0
- data/lib/assets/javascripts/attachy.js +289 -0
- data/lib/attachy.rb +13 -0
- data/lib/attachy/builders/attachy/form_builder.rb +15 -0
- data/lib/attachy/engine.rb +16 -0
- data/lib/attachy/helpers/attachy/view_helper.rb +31 -0
- data/lib/attachy/models/attachy/extension.rb +79 -0
- data/lib/attachy/models/attachy/file.rb +59 -0
- data/lib/attachy/models/attachy/viewer.rb +170 -0
- data/lib/attachy/version.rb +3 -0
- data/lib/generators/attachy/install_generator.rb +25 -0
- data/lib/generators/attachy/templates/config/attachy.yml.erb +15 -0
- data/lib/generators/attachy/templates/db/migrate/create_attachy_files_table.rb +19 -0
- data/lib/generators/attachy/templates/public/cloudinary_cors.html +46 -0
- data/spec/builders/attachy/form_builder/attachy_content_spec.rb +35 -0
- data/spec/builders/attachy/form_builder/attachy_file_field_spec.rb +23 -0
- data/spec/builders/attachy/form_builder/attachy_spec.rb +35 -0
- data/spec/factories/attachy/file.rb +12 -0
- data/spec/factories/user.rb +5 -0
- data/spec/helpers/attachy/attachy_content_spec.rb +21 -0
- data/spec/helpers/attachy/attachy_file_field_spec.rb +21 -0
- data/spec/helpers/attachy/attachy_spec.rb +35 -0
- data/spec/models/attachy/callback/destroy_file_spec.rb +55 -0
- data/spec/models/attachy/callback/remove_tmp_tag_spec.rb +11 -0
- data/spec/models/attachy/extension/user/avatar_spec.rb +91 -0
- data/spec/models/attachy/extension/user/photos_spec.rb +88 -0
- data/spec/models/attachy/file/config_spec.rb +11 -0
- data/spec/models/attachy/file/default_spec.rb +26 -0
- data/spec/models/attachy/file/path_spec.rb +16 -0
- data/spec/models/attachy/file/transform_spec.rb +86 -0
- data/spec/models/attachy/file_spec.rb +14 -0
- data/spec/models/attachy/viewer/attachments_spec.rb +28 -0
- data/spec/models/attachy/viewer/button_label_options_spec.rb +15 -0
- data/spec/models/attachy/viewer/button_label_spec.rb +34 -0
- data/spec/models/attachy/viewer/content_options_spec.rb +29 -0
- data/spec/models/attachy/viewer/content_spec.rb +62 -0
- data/spec/models/attachy/viewer/field_options_spec.rb +18 -0
- data/spec/models/attachy/viewer/field_spec.rb +56 -0
- data/spec/models/attachy/viewer/file_button_options_spec.rb +18 -0
- data/spec/models/attachy/viewer/file_button_spec.rb +57 -0
- data/spec/models/attachy/viewer/file_field_options_spec.rb +90 -0
- data/spec/models/attachy/viewer/file_field_spec.rb +25 -0
- data/spec/models/attachy/viewer/hidden_field_spec.rb +22 -0
- data/spec/models/attachy/viewer/image_spec.rb +170 -0
- data/spec/models/attachy/viewer/link_options_spec.rb +18 -0
- data/spec/models/attachy/viewer/link_spec.rb +131 -0
- data/spec/models/attachy/viewer/node_options_spec.rb +18 -0
- data/spec/models/attachy/viewer/node_spec.rb +134 -0
- data/spec/models/attachy/viewer/nodes_spec.rb +21 -0
- data/spec/models/attachy/viewer/remove_button_options_spec.rb +18 -0
- data/spec/models/attachy/viewer/transform_spec.rb +44 -0
- data/spec/models/attachy/viewer/value_spec.rb +83 -0
- data/spec/models/user_spec.rb +9 -0
- data/spec/rails_helper.rb +11 -0
- data/spec/support/common.rb +20 -0
- data/spec/support/database_cleaner.rb +19 -0
- data/spec/support/db/migrate/create_users_table.rb +7 -0
- data/spec/support/factory_girl.rb +7 -0
- data/spec/support/html_matchers.rb +5 -0
- data/spec/support/migrate.rb +4 -0
- data/spec/support/models/user.rb +5 -0
- data/spec/support/shoulda.rb +8 -0
- metadata +365 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe Attachy::Viewer, '.node_options' do
|
|
4
|
+
let!(:object) { create :user }
|
|
5
|
+
let!(:method) { :avatar }
|
|
6
|
+
|
|
7
|
+
let!(:file) do
|
|
8
|
+
allow(Cloudinary::Uploader).to receive(:remove_tag)
|
|
9
|
+
|
|
10
|
+
create :file, attachable: object, scope: method
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
subject { described_class.new method, object }
|
|
14
|
+
|
|
15
|
+
it 'returns the default node options' do
|
|
16
|
+
expect(subject.node_options).to eq(class: :attachy__node)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe Attachy::Viewer, '.node' do
|
|
4
|
+
let!(:method) { :avatar }
|
|
5
|
+
let!(:object) { create :user }
|
|
6
|
+
let!(:viewer) { described_class.new method, object, options }
|
|
7
|
+
let!(:default_html) { { alt: :image, height: 50, width: 150 } }
|
|
8
|
+
let!(:default_t) { { height: 100, width: 200 } }
|
|
9
|
+
let!(:options) { { t: default_t, html: default_html } }
|
|
10
|
+
|
|
11
|
+
let!(:file) do
|
|
12
|
+
allow(Cloudinary::Uploader).to receive(:remove_tag)
|
|
13
|
+
|
|
14
|
+
create :file, attachable: object
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
describe 'default options' do
|
|
18
|
+
before do
|
|
19
|
+
allow(viewer).to receive(:link) { 'http://example.org' }
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it 'adds the node options' do
|
|
23
|
+
el = viewer.node
|
|
24
|
+
|
|
25
|
+
expect(el).to have_tag :li, with: { class: 'attachy__node' }
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
context 'when :t is not given' do
|
|
30
|
+
before do
|
|
31
|
+
allow(viewer).to receive(:link).with(file, t: default_t, tl: { crop: :none }) { 'link' }
|
|
32
|
+
allow(viewer).to receive(:remove_button) { 'remove' }
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
it 'builds the imagem with generic transform' do
|
|
36
|
+
el = viewer.node
|
|
37
|
+
|
|
38
|
+
expect(el).to have_tag :li do
|
|
39
|
+
with_text 'linkremove'
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
context 'when :t is given' do
|
|
45
|
+
let!(:t) { { height: 7, width: 17 } }
|
|
46
|
+
|
|
47
|
+
before do
|
|
48
|
+
allow(viewer).to receive(:link).with(file, tl: { crop: :none }, t: t) { 'link' }
|
|
49
|
+
allow(viewer).to receive(:remove_button) { 'remove' }
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
it 'builds the imagem with given transform' do
|
|
53
|
+
el = viewer.node(t: t)
|
|
54
|
+
|
|
55
|
+
expect(el).to have_tag :li do
|
|
56
|
+
with_text 'linkremove'
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
context 'when :tl is not given' do
|
|
62
|
+
before do
|
|
63
|
+
allow(viewer).to receive(:link).with(file, tl: { crop: :none }, t: default_t) { 'link' }
|
|
64
|
+
allow(viewer).to receive(:remove_button) { 'remove' }
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
it 'builds the node with no crop' do
|
|
68
|
+
el = viewer.node
|
|
69
|
+
|
|
70
|
+
expect(el).to have_tag :li do
|
|
71
|
+
with_text 'linkremove'
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
context 'when :tl is given' do
|
|
77
|
+
let!(:tl) { { height: 7, width: 17 } }
|
|
78
|
+
|
|
79
|
+
before do
|
|
80
|
+
allow(viewer).to receive(:link).with(file, tl: tl, t: default_t) { 'link' }
|
|
81
|
+
allow(viewer).to receive(:remove_button) { 'remove' }
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
it 'builds the node with given transform' do
|
|
85
|
+
el = viewer.node(tl: tl)
|
|
86
|
+
|
|
87
|
+
expect(el).to have_tag :li do
|
|
88
|
+
with_text 'linkremove'
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
context 'when :html is present' do
|
|
94
|
+
let!(:html) { { invalid: :invalid } }
|
|
95
|
+
|
|
96
|
+
before do
|
|
97
|
+
allow(viewer).to receive(:link) { 'link' }
|
|
98
|
+
allow(viewer).to receive(:remove_button) { 'remove' }
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
it 'builds the node with given html' do
|
|
102
|
+
el = viewer.node(html: html)
|
|
103
|
+
|
|
104
|
+
expect(el).to have_tag :li, with: html
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
context 'when given a :file' do
|
|
109
|
+
let!(:other_file) { build :file }
|
|
110
|
+
|
|
111
|
+
before { allow(viewer).to receive(:remove_button) { 'remove' } }
|
|
112
|
+
|
|
113
|
+
it 'builds the node with given html' do
|
|
114
|
+
expect(viewer).to receive(:link).with(other_file, tl: { crop: :none }, t: default_t) { 'link' }
|
|
115
|
+
|
|
116
|
+
el = viewer.node(other_file)
|
|
117
|
+
|
|
118
|
+
expect(el).to have_tag :li do
|
|
119
|
+
with_text 'linkremove'
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
context 'when a block is given' do
|
|
125
|
+
let!(:html) { { target: :blank } }
|
|
126
|
+
|
|
127
|
+
it 'yields the :html and :attachments' do
|
|
128
|
+
viewer.node(html: html) do |htm, attachments|
|
|
129
|
+
expect(attachments).to eq [file]
|
|
130
|
+
expect(htm).to eq(target: :blank, class: :attachy__node)
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe Attachy::Viewer, '.nodes' do
|
|
4
|
+
let!(:object) { create :user }
|
|
5
|
+
let!(:method) { :photos }
|
|
6
|
+
let(:file_1) { create :file, attachable: object, scope: method }
|
|
7
|
+
let(:file_2) { create :file, attachable: object, scope: method }
|
|
8
|
+
|
|
9
|
+
before do
|
|
10
|
+
allow(Cloudinary::Uploader).to receive(:remove_tag)
|
|
11
|
+
|
|
12
|
+
allow(subject).to receive(:node).with(file_1) { :node_1 }
|
|
13
|
+
allow(subject).to receive(:node).with(file_2) { :node_2 }
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
subject { described_class.new method, object }
|
|
17
|
+
|
|
18
|
+
it 'returns the nodes with links inside as an array' do
|
|
19
|
+
expect(subject.nodes).to eq [:node_1, :node_2]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe Attachy::Viewer, '.remove_button_options' do
|
|
4
|
+
let!(:object) { create :user }
|
|
5
|
+
let!(:method) { :avatar }
|
|
6
|
+
|
|
7
|
+
let!(:file) do
|
|
8
|
+
allow(Cloudinary::Uploader).to receive(:remove_tag)
|
|
9
|
+
|
|
10
|
+
create :file, attachable: object, scope: method
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
subject { described_class.new method, object }
|
|
14
|
+
|
|
15
|
+
it 'returns the default remove button options' do
|
|
16
|
+
expect(subject.remove_button_options).to eq(class: :attachy__remove)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe Attachy::Viewer, '.remove_button' do
|
|
4
|
+
let!(:object) { create :user }
|
|
5
|
+
let!(:method) { :avatar }
|
|
6
|
+
|
|
7
|
+
let!(:file) do
|
|
8
|
+
allow(Cloudinary::Uploader).to receive(:remove_tag)
|
|
9
|
+
|
|
10
|
+
create :file, attachable: object, scope: method
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
subject { described_class.new method, object }
|
|
14
|
+
|
|
15
|
+
context 'when give no html options' do
|
|
16
|
+
it 'returns just the default options' do
|
|
17
|
+
el = subject.remove_button
|
|
18
|
+
|
|
19
|
+
expect(el).to have_tag :span, with: { class: 'attachy__remove' } do
|
|
20
|
+
with_text '×'
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
context 'when give html options' do
|
|
26
|
+
let!(:html) { { attribute: :value } }
|
|
27
|
+
|
|
28
|
+
it 'merges with default options' do
|
|
29
|
+
el = subject.remove_button(html: html)
|
|
30
|
+
|
|
31
|
+
expect(el).to have_tag :span, with: { attribute: :value, class: 'attachy__remove' }
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
context 'when a block is given' do
|
|
36
|
+
let!(:html) { { target: :blank } }
|
|
37
|
+
|
|
38
|
+
it 'yields the :html' do
|
|
39
|
+
subject.remove_button(html: html) do |h|
|
|
40
|
+
expect(h).to eq(target: :blank, class: :attachy__remove)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe Attachy::Viewer, '.value' do
|
|
4
|
+
let!(:object) { create :user }
|
|
5
|
+
|
|
6
|
+
before { allow(Cloudinary::Uploader).to receive(:remove_tag) }
|
|
7
|
+
|
|
8
|
+
context 'when has one result' do
|
|
9
|
+
context 'as attachament' do
|
|
10
|
+
let!(:method) { :avatar }
|
|
11
|
+
let!(:file) { create :file, attachable: object, scope: method }
|
|
12
|
+
|
|
13
|
+
subject { described_class.new method, object }
|
|
14
|
+
|
|
15
|
+
context 'and it is not default' do
|
|
16
|
+
let!(:default) { Attachy::File.new public_id: 0 }
|
|
17
|
+
|
|
18
|
+
before do
|
|
19
|
+
allow(Attachy::File).to receive(:default) { default }
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it 'is represented as an array of one json' do
|
|
23
|
+
expect(subject.value).to eq [file].to_json
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
context 'and it is default' do
|
|
28
|
+
let!(:default) { Attachy::File.new public_id: file.public_id }
|
|
29
|
+
|
|
30
|
+
before do
|
|
31
|
+
allow(Attachy::File).to receive(:default) { default }
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it 'ignores the virtual default value and returns an empty data' do
|
|
35
|
+
expect(subject.value).to eq '[]'
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
context 'as attachaments' do
|
|
41
|
+
let!(:method) { :photos }
|
|
42
|
+
let!(:file) { create :file, attachable: object, scope: method }
|
|
43
|
+
|
|
44
|
+
subject { described_class.new method, object }
|
|
45
|
+
|
|
46
|
+
context 'and it is not default' do
|
|
47
|
+
let!(:default) { Attachy::File.new public_id: 0 }
|
|
48
|
+
|
|
49
|
+
before do
|
|
50
|
+
allow(Attachy::File).to receive(:default) { default }
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
it 'is represented as json' do
|
|
54
|
+
expect(subject.value).to eq [file].to_json
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
context 'and it is default' do
|
|
59
|
+
let!(:default) { Attachy::File.new public_id: file.public_id }
|
|
60
|
+
|
|
61
|
+
before do
|
|
62
|
+
allow(Attachy::File).to receive(:default) { default }
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
it 'ignores the virtual default value and returns an empty data' do
|
|
66
|
+
expect(subject.value).to eq '[]'
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
context 'when has more than one result' do
|
|
73
|
+
let!(:method) { :photos }
|
|
74
|
+
let!(:file_1) { create :file, attachable: object, scope: :photos }
|
|
75
|
+
let!(:file_2) { create :file, attachable: object, scope: :photos }
|
|
76
|
+
|
|
77
|
+
subject { described_class.new method, object }
|
|
78
|
+
|
|
79
|
+
it 'is represented as json' do
|
|
80
|
+
expect(subject.value).to eq [file_1, file_2].to_json
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
require 'rails_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe User do
|
|
4
|
+
it { expect(build(:user)).to be_valid }
|
|
5
|
+
|
|
6
|
+
it { is_expected.to have_many(:avatar_files).conditions(scope: :avatar).class_name(Attachy::File).dependent :destroy }
|
|
7
|
+
|
|
8
|
+
it { is_expected.to have_many(:photos_files).conditions(scope: :photos).class_name(Attachy::File).dependent :destroy }
|
|
9
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
ENV['RAILS_ENV'] ||= 'test'
|
|
4
|
+
|
|
5
|
+
require 'active_record/railtie'
|
|
6
|
+
require 'attachy'
|
|
7
|
+
require 'pry-byebug'
|
|
8
|
+
|
|
9
|
+
ActiveRecord::Base.establish_connection adapter: :sqlite3, database: ':memory:'
|
|
10
|
+
|
|
11
|
+
Dir[File.expand_path('support/**/*.rb', __dir__)].each { |file| require file }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require 'rspec/rails'
|
|
2
|
+
|
|
3
|
+
RSpec.configure do |config|
|
|
4
|
+
config.filter_run_when_matching :focus
|
|
5
|
+
|
|
6
|
+
config.disable_monkey_patching!
|
|
7
|
+
config.infer_spec_type_from_file_location!
|
|
8
|
+
|
|
9
|
+
config.expect_with :rspec do |expectations|
|
|
10
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
config.mock_with :rspec do |mocks|
|
|
14
|
+
mocks.verify_partial_doubles = true
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
config.infer_base_class_for_anonymous_controllers = false
|
|
18
|
+
config.order = :random
|
|
19
|
+
config.profile_examples = true
|
|
20
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'database_cleaner'
|
|
2
|
+
|
|
3
|
+
RSpec.configure do |config|
|
|
4
|
+
config.before :suite do
|
|
5
|
+
DatabaseCleaner.strategy = :transaction
|
|
6
|
+
|
|
7
|
+
DatabaseCleaner.clean_with :truncation
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
config.before :each do
|
|
11
|
+
DatabaseCleaner.start
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
config.around do |spec|
|
|
15
|
+
DatabaseCleaner.cleaning do
|
|
16
|
+
spec.run
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: attachy
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Washington Botelho
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2017-03-14 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: cloudinary
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.5'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.5'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rails
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '5.0'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '5.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: bundler
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: database_cleaner
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: factory_girl_rails
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: guard-rspec
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '0'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '0'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: rails-controller-testing
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - ">="
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '0'
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - ">="
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '0'
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: rspec-html-matchers
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - ">="
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '0'
|
|
118
|
+
type: :development
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - ">="
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: '0'
|
|
125
|
+
- !ruby/object:Gem::Dependency
|
|
126
|
+
name: rspec-rails
|
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
- - ">="
|
|
130
|
+
- !ruby/object:Gem::Version
|
|
131
|
+
version: '0'
|
|
132
|
+
type: :development
|
|
133
|
+
prerelease: false
|
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
+
requirements:
|
|
136
|
+
- - ">="
|
|
137
|
+
- !ruby/object:Gem::Version
|
|
138
|
+
version: '0'
|
|
139
|
+
- !ruby/object:Gem::Dependency
|
|
140
|
+
name: rspec
|
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
|
142
|
+
requirements:
|
|
143
|
+
- - ">="
|
|
144
|
+
- !ruby/object:Gem::Version
|
|
145
|
+
version: '0'
|
|
146
|
+
type: :development
|
|
147
|
+
prerelease: false
|
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
149
|
+
requirements:
|
|
150
|
+
- - ">="
|
|
151
|
+
- !ruby/object:Gem::Version
|
|
152
|
+
version: '0'
|
|
153
|
+
- !ruby/object:Gem::Dependency
|
|
154
|
+
name: rubocop-rspec
|
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
|
156
|
+
requirements:
|
|
157
|
+
- - ">="
|
|
158
|
+
- !ruby/object:Gem::Version
|
|
159
|
+
version: '0'
|
|
160
|
+
type: :development
|
|
161
|
+
prerelease: false
|
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
163
|
+
requirements:
|
|
164
|
+
- - ">="
|
|
165
|
+
- !ruby/object:Gem::Version
|
|
166
|
+
version: '0'
|
|
167
|
+
- !ruby/object:Gem::Dependency
|
|
168
|
+
name: rubocop
|
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
|
170
|
+
requirements:
|
|
171
|
+
- - ">="
|
|
172
|
+
- !ruby/object:Gem::Version
|
|
173
|
+
version: '0'
|
|
174
|
+
type: :development
|
|
175
|
+
prerelease: false
|
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
177
|
+
requirements:
|
|
178
|
+
- - ">="
|
|
179
|
+
- !ruby/object:Gem::Version
|
|
180
|
+
version: '0'
|
|
181
|
+
- !ruby/object:Gem::Dependency
|
|
182
|
+
name: shoulda-matchers
|
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
|
184
|
+
requirements:
|
|
185
|
+
- - ">="
|
|
186
|
+
- !ruby/object:Gem::Version
|
|
187
|
+
version: '0'
|
|
188
|
+
type: :development
|
|
189
|
+
prerelease: false
|
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
191
|
+
requirements:
|
|
192
|
+
- - ">="
|
|
193
|
+
- !ruby/object:Gem::Version
|
|
194
|
+
version: '0'
|
|
195
|
+
- !ruby/object:Gem::Dependency
|
|
196
|
+
name: sqlite3
|
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
|
198
|
+
requirements:
|
|
199
|
+
- - ">="
|
|
200
|
+
- !ruby/object:Gem::Version
|
|
201
|
+
version: '0'
|
|
202
|
+
type: :development
|
|
203
|
+
prerelease: false
|
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
205
|
+
requirements:
|
|
206
|
+
- - ">="
|
|
207
|
+
- !ruby/object:Gem::Version
|
|
208
|
+
version: '0'
|
|
209
|
+
- !ruby/object:Gem::Dependency
|
|
210
|
+
name: pry-byebug
|
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
|
212
|
+
requirements:
|
|
213
|
+
- - ">="
|
|
214
|
+
- !ruby/object:Gem::Version
|
|
215
|
+
version: '0'
|
|
216
|
+
type: :development
|
|
217
|
+
prerelease: false
|
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
219
|
+
requirements:
|
|
220
|
+
- - ">="
|
|
221
|
+
- !ruby/object:Gem::Version
|
|
222
|
+
version: '0'
|
|
223
|
+
description: Attachments handler for Rails via Cloudinary.
|
|
224
|
+
email: wbotelhos@gmail.com
|
|
225
|
+
executables: []
|
|
226
|
+
extensions: []
|
|
227
|
+
extra_rdoc_files: []
|
|
228
|
+
files:
|
|
229
|
+
- CHANGELOG.md
|
|
230
|
+
- LICENSE
|
|
231
|
+
- README.md
|
|
232
|
+
- lib/assets/javascripts/attachy.js
|
|
233
|
+
- lib/attachy.rb
|
|
234
|
+
- lib/attachy/builders/attachy/form_builder.rb
|
|
235
|
+
- lib/attachy/engine.rb
|
|
236
|
+
- lib/attachy/helpers/attachy/view_helper.rb
|
|
237
|
+
- lib/attachy/models/attachy/extension.rb
|
|
238
|
+
- lib/attachy/models/attachy/file.rb
|
|
239
|
+
- lib/attachy/models/attachy/viewer.rb
|
|
240
|
+
- lib/attachy/version.rb
|
|
241
|
+
- lib/generators/attachy/install_generator.rb
|
|
242
|
+
- lib/generators/attachy/templates/config/attachy.yml.erb
|
|
243
|
+
- lib/generators/attachy/templates/db/migrate/create_attachy_files_table.rb
|
|
244
|
+
- lib/generators/attachy/templates/public/cloudinary_cors.html
|
|
245
|
+
- spec/builders/attachy/form_builder/attachy_content_spec.rb
|
|
246
|
+
- spec/builders/attachy/form_builder/attachy_file_field_spec.rb
|
|
247
|
+
- spec/builders/attachy/form_builder/attachy_spec.rb
|
|
248
|
+
- spec/factories/attachy/file.rb
|
|
249
|
+
- spec/factories/user.rb
|
|
250
|
+
- spec/helpers/attachy/attachy_content_spec.rb
|
|
251
|
+
- spec/helpers/attachy/attachy_file_field_spec.rb
|
|
252
|
+
- spec/helpers/attachy/attachy_spec.rb
|
|
253
|
+
- spec/models/attachy/callback/destroy_file_spec.rb
|
|
254
|
+
- spec/models/attachy/callback/remove_tmp_tag_spec.rb
|
|
255
|
+
- spec/models/attachy/extension/user/avatar_spec.rb
|
|
256
|
+
- spec/models/attachy/extension/user/photos_spec.rb
|
|
257
|
+
- spec/models/attachy/file/config_spec.rb
|
|
258
|
+
- spec/models/attachy/file/default_spec.rb
|
|
259
|
+
- spec/models/attachy/file/path_spec.rb
|
|
260
|
+
- spec/models/attachy/file/transform_spec.rb
|
|
261
|
+
- spec/models/attachy/file_spec.rb
|
|
262
|
+
- spec/models/attachy/viewer/attachments_spec.rb
|
|
263
|
+
- spec/models/attachy/viewer/button_label_options_spec.rb
|
|
264
|
+
- spec/models/attachy/viewer/button_label_spec.rb
|
|
265
|
+
- spec/models/attachy/viewer/content_options_spec.rb
|
|
266
|
+
- spec/models/attachy/viewer/content_spec.rb
|
|
267
|
+
- spec/models/attachy/viewer/field_options_spec.rb
|
|
268
|
+
- spec/models/attachy/viewer/field_spec.rb
|
|
269
|
+
- spec/models/attachy/viewer/file_button_options_spec.rb
|
|
270
|
+
- spec/models/attachy/viewer/file_button_spec.rb
|
|
271
|
+
- spec/models/attachy/viewer/file_field_options_spec.rb
|
|
272
|
+
- spec/models/attachy/viewer/file_field_spec.rb
|
|
273
|
+
- spec/models/attachy/viewer/hidden_field_spec.rb
|
|
274
|
+
- spec/models/attachy/viewer/image_spec.rb
|
|
275
|
+
- spec/models/attachy/viewer/link_options_spec.rb
|
|
276
|
+
- spec/models/attachy/viewer/link_spec.rb
|
|
277
|
+
- spec/models/attachy/viewer/node_options_spec.rb
|
|
278
|
+
- spec/models/attachy/viewer/node_spec.rb
|
|
279
|
+
- spec/models/attachy/viewer/nodes_spec.rb
|
|
280
|
+
- spec/models/attachy/viewer/remove_button_options_spec.rb
|
|
281
|
+
- spec/models/attachy/viewer/transform_spec.rb
|
|
282
|
+
- spec/models/attachy/viewer/value_spec.rb
|
|
283
|
+
- spec/models/user_spec.rb
|
|
284
|
+
- spec/rails_helper.rb
|
|
285
|
+
- spec/support/common.rb
|
|
286
|
+
- spec/support/database_cleaner.rb
|
|
287
|
+
- spec/support/db/migrate/create_users_table.rb
|
|
288
|
+
- spec/support/factory_girl.rb
|
|
289
|
+
- spec/support/html_matchers.rb
|
|
290
|
+
- spec/support/migrate.rb
|
|
291
|
+
- spec/support/models/user.rb
|
|
292
|
+
- spec/support/shoulda.rb
|
|
293
|
+
homepage: https://github.com/wbotelhos/attachy
|
|
294
|
+
licenses:
|
|
295
|
+
- MIT
|
|
296
|
+
metadata: {}
|
|
297
|
+
post_install_message:
|
|
298
|
+
rdoc_options: []
|
|
299
|
+
require_paths:
|
|
300
|
+
- lib
|
|
301
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
302
|
+
requirements:
|
|
303
|
+
- - ">="
|
|
304
|
+
- !ruby/object:Gem::Version
|
|
305
|
+
version: '0'
|
|
306
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
307
|
+
requirements:
|
|
308
|
+
- - ">="
|
|
309
|
+
- !ruby/object:Gem::Version
|
|
310
|
+
version: '0'
|
|
311
|
+
requirements: []
|
|
312
|
+
rubyforge_project:
|
|
313
|
+
rubygems_version: 2.6.8
|
|
314
|
+
signing_key:
|
|
315
|
+
specification_version: 4
|
|
316
|
+
summary: Attachments handler for Rails via Cloudinary.
|
|
317
|
+
test_files:
|
|
318
|
+
- spec/builders/attachy/form_builder/attachy_content_spec.rb
|
|
319
|
+
- spec/builders/attachy/form_builder/attachy_file_field_spec.rb
|
|
320
|
+
- spec/builders/attachy/form_builder/attachy_spec.rb
|
|
321
|
+
- spec/factories/attachy/file.rb
|
|
322
|
+
- spec/factories/user.rb
|
|
323
|
+
- spec/helpers/attachy/attachy_content_spec.rb
|
|
324
|
+
- spec/helpers/attachy/attachy_file_field_spec.rb
|
|
325
|
+
- spec/helpers/attachy/attachy_spec.rb
|
|
326
|
+
- spec/models/attachy/callback/destroy_file_spec.rb
|
|
327
|
+
- spec/models/attachy/callback/remove_tmp_tag_spec.rb
|
|
328
|
+
- spec/models/attachy/extension/user/avatar_spec.rb
|
|
329
|
+
- spec/models/attachy/extension/user/photos_spec.rb
|
|
330
|
+
- spec/models/attachy/file/config_spec.rb
|
|
331
|
+
- spec/models/attachy/file/default_spec.rb
|
|
332
|
+
- spec/models/attachy/file/path_spec.rb
|
|
333
|
+
- spec/models/attachy/file/transform_spec.rb
|
|
334
|
+
- spec/models/attachy/file_spec.rb
|
|
335
|
+
- spec/models/attachy/viewer/attachments_spec.rb
|
|
336
|
+
- spec/models/attachy/viewer/button_label_options_spec.rb
|
|
337
|
+
- spec/models/attachy/viewer/button_label_spec.rb
|
|
338
|
+
- spec/models/attachy/viewer/content_options_spec.rb
|
|
339
|
+
- spec/models/attachy/viewer/content_spec.rb
|
|
340
|
+
- spec/models/attachy/viewer/field_options_spec.rb
|
|
341
|
+
- spec/models/attachy/viewer/field_spec.rb
|
|
342
|
+
- spec/models/attachy/viewer/file_button_options_spec.rb
|
|
343
|
+
- spec/models/attachy/viewer/file_button_spec.rb
|
|
344
|
+
- spec/models/attachy/viewer/file_field_options_spec.rb
|
|
345
|
+
- spec/models/attachy/viewer/file_field_spec.rb
|
|
346
|
+
- spec/models/attachy/viewer/hidden_field_spec.rb
|
|
347
|
+
- spec/models/attachy/viewer/image_spec.rb
|
|
348
|
+
- spec/models/attachy/viewer/link_options_spec.rb
|
|
349
|
+
- spec/models/attachy/viewer/link_spec.rb
|
|
350
|
+
- spec/models/attachy/viewer/node_options_spec.rb
|
|
351
|
+
- spec/models/attachy/viewer/node_spec.rb
|
|
352
|
+
- spec/models/attachy/viewer/nodes_spec.rb
|
|
353
|
+
- spec/models/attachy/viewer/remove_button_options_spec.rb
|
|
354
|
+
- spec/models/attachy/viewer/transform_spec.rb
|
|
355
|
+
- spec/models/attachy/viewer/value_spec.rb
|
|
356
|
+
- spec/models/user_spec.rb
|
|
357
|
+
- spec/rails_helper.rb
|
|
358
|
+
- spec/support/common.rb
|
|
359
|
+
- spec/support/database_cleaner.rb
|
|
360
|
+
- spec/support/db/migrate/create_users_table.rb
|
|
361
|
+
- spec/support/factory_girl.rb
|
|
362
|
+
- spec/support/html_matchers.rb
|
|
363
|
+
- spec/support/migrate.rb
|
|
364
|
+
- spec/support/models/user.rb
|
|
365
|
+
- spec/support/shoulda.rb
|