easy-resources 0.5.5 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -0
- data/lib/easy/resources/redmine/redmine_base.rb +1 -0
- data/lib/easy/resources/redmine/user.rb +15 -0
- data/lib/easy/resources/version.rb +1 -1
- data/lib/easy/resources.rb +1 -0
- data/spec/easy_resources_spec.rb +20 -0
- data/spec/fixtures/files/user/show.xml +21 -0
- data/spec/models/easy-resources/redmine/user_spec.rb +19 -0
- data/spec/spec_helper.rb +4 -1
- metadata +9 -113
- data/spec/dummy/Rakefile +0 -6
- data/spec/dummy/app/assets/config/manifest.js +0 -3
- data/spec/dummy/app/assets/javascripts/application.js +0 -15
- data/spec/dummy/app/assets/javascripts/cable.js +0 -13
- data/spec/dummy/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy/app/channels/application_cable/channel.rb +0 -4
- data/spec/dummy/app/channels/application_cable/connection.rb +0 -4
- data/spec/dummy/app/controllers/application_controller.rb +0 -2
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/jobs/application_job.rb +0 -2
- data/spec/dummy/app/mailers/application_mailer.rb +0 -4
- data/spec/dummy/app/models/application_record.rb +0 -3
- data/spec/dummy/app/views/layouts/application.html.erb +0 -15
- data/spec/dummy/app/views/layouts/mailer.html.erb +0 -13
- data/spec/dummy/app/views/layouts/mailer.text.erb +0 -1
- data/spec/dummy/bin/bundle +0 -3
- data/spec/dummy/bin/rails +0 -4
- data/spec/dummy/bin/rake +0 -4
- data/spec/dummy/bin/setup +0 -36
- data/spec/dummy/bin/update +0 -31
- data/spec/dummy/bin/yarn +0 -11
- data/spec/dummy/config/application.rb +0 -19
- data/spec/dummy/config/boot.rb +0 -5
- data/spec/dummy/config/cable.yml +0 -10
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -61
- data/spec/dummy/config/environments/production.rb +0 -94
- data/spec/dummy/config/environments/test.rb +0 -46
- data/spec/dummy/config/initializers/application_controller_renderer.rb +0 -8
- data/spec/dummy/config/initializers/assets.rb +0 -14
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/content_security_policy.rb +0 -25
- data/spec/dummy/config/initializers/cookies_serializer.rb +0 -5
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy/config/initializers/inflections.rb +0 -16
- data/spec/dummy/config/initializers/mime_types.rb +0 -4
- data/spec/dummy/config/initializers/new_framework_defaults_5_2.rb +0 -38
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/en.yml +0 -33
- data/spec/dummy/config/puma.rb +0 -34
- data/spec/dummy/config/routes.rb +0 -3
- data/spec/dummy/config/spring.rb +0 -6
- data/spec/dummy/config/storage.yml +0 -34
- data/spec/dummy/config.ru +0 -5
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/test.log +0 -0
- data/spec/dummy/package.json +0 -5
- data/spec/dummy/public/404.html +0 -67
- data/spec/dummy/public/422.html +0 -67
- data/spec/dummy/public/500.html +0 -66
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64a20718aae7ffc73d9edfc4c85e72753304cf64f9b2f46110495188e69069fb
|
4
|
+
data.tar.gz: 0b2b651ccb2de8b5e2f4c1dd621cccf99e09d6125bf03deaffa02ca1485ba7fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7bbd2dfa99cd99f3ffe8b131915cd3f987a330dcbb3b4a670b5afd3c7fdc734b54bc4aef50a178fb551a7a2082bc0d74a88509085137eecaf6e1dacd8acb065
|
7
|
+
data.tar.gz: fc51e66045ed5cd92619a30c0f0267fe4f9d3e35ec220f38bb905a1ca3628d9625ce5e77418d4471ed33991934493b498609f13ae4fefa8d04781ca523ba1f2a
|
data/README.md
CHANGED
@@ -20,6 +20,30 @@ And then execute:
|
|
20
20
|
|
21
21
|
$ bundle
|
22
22
|
|
23
|
+
## Configuration
|
24
|
+
|
25
|
+
1. in config/secrets.yml
|
26
|
+
```yaml
|
27
|
+
production:
|
28
|
+
sites:
|
29
|
+
redmine:
|
30
|
+
api_key: secret
|
31
|
+
url: https://redmine.app
|
32
|
+
```
|
33
|
+
2. then in config/initializers/easy.rb
|
34
|
+
```ruby
|
35
|
+
require "easy/configuration"
|
36
|
+
Easy::Resources::Redmine::RedmineBase.configure
|
37
|
+
```
|
38
|
+
|
39
|
+
OR
|
40
|
+
|
41
|
+
just in config/initializers/easy.rb
|
42
|
+
```ruby
|
43
|
+
require "easy/configuration"
|
44
|
+
Easy::Resources::Redmine::RedmineBase.configure api_key: "secret", url: "https://redmine.app"
|
45
|
+
```
|
46
|
+
|
23
47
|
## Development
|
24
48
|
|
25
49
|
run bundle install install and do not forget to run `rspec`.
|
data/lib/easy/resources.rb
CHANGED
data/spec/easy_resources_spec.rb
CHANGED
@@ -5,4 +5,24 @@ RSpec.describe Easy::Resources do
|
|
5
5
|
expect(Easy::Resources::VERSION).not_to be nil
|
6
6
|
end
|
7
7
|
|
8
|
+
describe '.configure' do
|
9
|
+
|
10
|
+
context "Easy::Resource" do
|
11
|
+
it "resource raise error" do
|
12
|
+
expect { Easy::Resource.configure api_key: "xx1", url: "https://test.dummy" }.to raise_exception NoMethodError
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context "Easy::Resources::Redmine::RedmineBase" do
|
17
|
+
it "Easy::Resources::Redmine::RedmineBase" do
|
18
|
+
expect(Easy::Resources::Redmine::RedmineBase).to receive(:api_key=).with("xx1")
|
19
|
+
expect(Easy::Resources::Redmine::RedmineBase).to receive(:site=).with("https://test.dummy")
|
20
|
+
Easy::Resources::Redmine::RedmineBase.configure api_key: "xx1", url: "https://test.dummy"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
end
|
27
|
+
|
8
28
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<user>
|
3
|
+
<id>34</id>
|
4
|
+
<login>consultant1</login>
|
5
|
+
<admin>false</admin>
|
6
|
+
<firstname>Connie</firstname>
|
7
|
+
<lastname>Consultant</lastname>
|
8
|
+
<utc_offset>0</utc_offset>
|
9
|
+
<mail>cons1@easy.cz</mail>
|
10
|
+
<created_on>2017-10-21T22:00:00Z</created_on>
|
11
|
+
<last_login_on/>
|
12
|
+
<status>1</status>
|
13
|
+
<easy_system_flag>false</easy_system_flag>
|
14
|
+
<easy_external_id/>
|
15
|
+
<easy_user_type id="4" name="Project manager"/>
|
16
|
+
<easy_lesser_admin>false</easy_lesser_admin>
|
17
|
+
<language>en</language>
|
18
|
+
<avatar_url>
|
19
|
+
https://demo.easyproject.com/images/easy_images/easy_avatars/13/small/265495.jpg?1489589966
|
20
|
+
</avatar_url>
|
21
|
+
</user>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
RSpec.describe Easy::Resources::Redmine::User do
|
2
|
+
include_context "redmine active resource shares" do
|
3
|
+
let(:entity_name) { 'user' }
|
4
|
+
end
|
5
|
+
|
6
|
+
|
7
|
+
it 'get user' do
|
8
|
+
expect(find_entity.mail).not_to be_empty
|
9
|
+
end
|
10
|
+
|
11
|
+
it "#name" do
|
12
|
+
expect(find_entity.name).to eq "Connie Consultant"
|
13
|
+
end
|
14
|
+
#
|
15
|
+
# it 'issue has project' do
|
16
|
+
# expect(find_entity.project).to be_a Easy::Resources::Redmine::Project
|
17
|
+
# end
|
18
|
+
|
19
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy-resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- petr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03
|
11
|
+
date: 2019-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -143,63 +143,9 @@ files:
|
|
143
143
|
- lib/easy/resources/redmine/issue.rb
|
144
144
|
- lib/easy/resources/redmine/project.rb
|
145
145
|
- lib/easy/resources/redmine/redmine_base.rb
|
146
|
+
- lib/easy/resources/redmine/user.rb
|
146
147
|
- lib/easy/resources/spec_helper.rb
|
147
148
|
- lib/easy/resources/version.rb
|
148
|
-
- spec/dummy/Rakefile
|
149
|
-
- spec/dummy/app/assets/config/manifest.js
|
150
|
-
- spec/dummy/app/assets/javascripts/application.js
|
151
|
-
- spec/dummy/app/assets/javascripts/cable.js
|
152
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
153
|
-
- spec/dummy/app/channels/application_cable/channel.rb
|
154
|
-
- spec/dummy/app/channels/application_cable/connection.rb
|
155
|
-
- spec/dummy/app/controllers/application_controller.rb
|
156
|
-
- spec/dummy/app/helpers/application_helper.rb
|
157
|
-
- spec/dummy/app/jobs/application_job.rb
|
158
|
-
- spec/dummy/app/mailers/application_mailer.rb
|
159
|
-
- spec/dummy/app/models/application_record.rb
|
160
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
161
|
-
- spec/dummy/app/views/layouts/mailer.html.erb
|
162
|
-
- spec/dummy/app/views/layouts/mailer.text.erb
|
163
|
-
- spec/dummy/bin/bundle
|
164
|
-
- spec/dummy/bin/rails
|
165
|
-
- spec/dummy/bin/rake
|
166
|
-
- spec/dummy/bin/setup
|
167
|
-
- spec/dummy/bin/update
|
168
|
-
- spec/dummy/bin/yarn
|
169
|
-
- spec/dummy/config.ru
|
170
|
-
- spec/dummy/config/application.rb
|
171
|
-
- spec/dummy/config/boot.rb
|
172
|
-
- spec/dummy/config/cable.yml
|
173
|
-
- spec/dummy/config/database.yml
|
174
|
-
- spec/dummy/config/environment.rb
|
175
|
-
- spec/dummy/config/environments/development.rb
|
176
|
-
- spec/dummy/config/environments/production.rb
|
177
|
-
- spec/dummy/config/environments/test.rb
|
178
|
-
- spec/dummy/config/initializers/application_controller_renderer.rb
|
179
|
-
- spec/dummy/config/initializers/assets.rb
|
180
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
181
|
-
- spec/dummy/config/initializers/content_security_policy.rb
|
182
|
-
- spec/dummy/config/initializers/cookies_serializer.rb
|
183
|
-
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
184
|
-
- spec/dummy/config/initializers/inflections.rb
|
185
|
-
- spec/dummy/config/initializers/mime_types.rb
|
186
|
-
- spec/dummy/config/initializers/new_framework_defaults_5_2.rb
|
187
|
-
- spec/dummy/config/initializers/wrap_parameters.rb
|
188
|
-
- spec/dummy/config/locales/en.yml
|
189
|
-
- spec/dummy/config/puma.rb
|
190
|
-
- spec/dummy/config/routes.rb
|
191
|
-
- spec/dummy/config/spring.rb
|
192
|
-
- spec/dummy/config/storage.yml
|
193
|
-
- spec/dummy/db/test.sqlite3
|
194
|
-
- spec/dummy/log/development.log
|
195
|
-
- spec/dummy/log/test.log
|
196
|
-
- spec/dummy/package.json
|
197
|
-
- spec/dummy/public/404.html
|
198
|
-
- spec/dummy/public/422.html
|
199
|
-
- spec/dummy/public/500.html
|
200
|
-
- spec/dummy/public/apple-touch-icon-precomposed.png
|
201
|
-
- spec/dummy/public/apple-touch-icon.png
|
202
|
-
- spec/dummy/public/favicon.ico
|
203
149
|
- spec/easy_resources_spec.rb
|
204
150
|
- spec/fixtures/files/easy_contact.json
|
205
151
|
- spec/fixtures/files/easy_contact/show.xml
|
@@ -218,6 +164,7 @@ files:
|
|
218
164
|
- spec/fixtures/files/issue/show.xml
|
219
165
|
- spec/fixtures/files/project.json
|
220
166
|
- spec/fixtures/files/project/show.xml
|
167
|
+
- spec/fixtures/files/user/show.xml
|
221
168
|
- spec/models/easy-resources/redmine/easy_contact_spec.rb
|
222
169
|
- spec/models/easy-resources/redmine/easy_crm_case_spec.rb
|
223
170
|
- spec/models/easy-resources/redmine/easy_web_application_activity_spec.rb
|
@@ -225,6 +172,7 @@ files:
|
|
225
172
|
- spec/models/easy-resources/redmine/issue_spec.rb
|
226
173
|
- spec/models/easy-resources/redmine/project_spec.rb
|
227
174
|
- spec/models/easy-resources/redmine/redmine_base_spec.rb
|
175
|
+
- spec/models/easy-resources/redmine/user_spec.rb
|
228
176
|
- spec/models/easy-resources/resource_spec.rb
|
229
177
|
- spec/spec_helper.rb
|
230
178
|
- spec/support/active_resource.rb
|
@@ -250,67 +198,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
250
198
|
- !ruby/object:Gem::Version
|
251
199
|
version: '0'
|
252
200
|
requirements: []
|
253
|
-
|
201
|
+
rubyforge_project:
|
202
|
+
rubygems_version: 2.7.6
|
254
203
|
signing_key:
|
255
204
|
specification_version: 4
|
256
205
|
summary: Summary of Easy::Resources.
|
257
206
|
test_files:
|
258
207
|
- spec/spec_helper.rb
|
259
|
-
- spec/dummy/app/mailers/application_mailer.rb
|
260
|
-
- spec/dummy/app/models/application_record.rb
|
261
|
-
- spec/dummy/app/jobs/application_job.rb
|
262
|
-
- spec/dummy/app/controllers/application_controller.rb
|
263
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
264
|
-
- spec/dummy/app/views/layouts/mailer.html.erb
|
265
|
-
- spec/dummy/app/views/layouts/mailer.text.erb
|
266
|
-
- spec/dummy/app/assets/config/manifest.js
|
267
|
-
- spec/dummy/app/assets/javascripts/cable.js
|
268
|
-
- spec/dummy/app/assets/javascripts/application.js
|
269
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
270
|
-
- spec/dummy/app/helpers/application_helper.rb
|
271
|
-
- spec/dummy/app/channels/application_cable/connection.rb
|
272
|
-
- spec/dummy/app/channels/application_cable/channel.rb
|
273
|
-
- spec/dummy/bin/update
|
274
|
-
- spec/dummy/bin/rake
|
275
|
-
- spec/dummy/bin/setup
|
276
|
-
- spec/dummy/bin/bundle
|
277
|
-
- spec/dummy/bin/yarn
|
278
|
-
- spec/dummy/bin/rails
|
279
|
-
- spec/dummy/config/routes.rb
|
280
|
-
- spec/dummy/config/locales/en.yml
|
281
|
-
- spec/dummy/config/cable.yml
|
282
|
-
- spec/dummy/config/environments/production.rb
|
283
|
-
- spec/dummy/config/environments/development.rb
|
284
|
-
- spec/dummy/config/environments/test.rb
|
285
|
-
- spec/dummy/config/spring.rb
|
286
|
-
- spec/dummy/config/environment.rb
|
287
|
-
- spec/dummy/config/storage.yml
|
288
|
-
- spec/dummy/config/application.rb
|
289
|
-
- spec/dummy/config/puma.rb
|
290
|
-
- spec/dummy/config/database.yml
|
291
|
-
- spec/dummy/config/boot.rb
|
292
|
-
- spec/dummy/config/initializers/application_controller_renderer.rb
|
293
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
294
|
-
- spec/dummy/config/initializers/mime_types.rb
|
295
|
-
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
296
|
-
- spec/dummy/config/initializers/wrap_parameters.rb
|
297
|
-
- spec/dummy/config/initializers/assets.rb
|
298
|
-
- spec/dummy/config/initializers/cookies_serializer.rb
|
299
|
-
- spec/dummy/config/initializers/content_security_policy.rb
|
300
|
-
- spec/dummy/config/initializers/inflections.rb
|
301
|
-
- spec/dummy/config/initializers/new_framework_defaults_5_2.rb
|
302
|
-
- spec/dummy/config.ru
|
303
|
-
- spec/dummy/Rakefile
|
304
|
-
- spec/dummy/public/favicon.ico
|
305
|
-
- spec/dummy/public/422.html
|
306
|
-
- spec/dummy/public/apple-touch-icon.png
|
307
|
-
- spec/dummy/public/500.html
|
308
|
-
- spec/dummy/public/404.html
|
309
|
-
- spec/dummy/public/apple-touch-icon-precomposed.png
|
310
|
-
- spec/dummy/package.json
|
311
|
-
- spec/dummy/db/test.sqlite3
|
312
|
-
- spec/dummy/log/test.log
|
313
|
-
- spec/dummy/log/development.log
|
314
208
|
- spec/models/easy-resources/redmine/project_spec.rb
|
315
209
|
- spec/models/easy-resources/redmine/easy_crm_case_spec.rb
|
316
210
|
- spec/models/easy-resources/redmine/easy_contact_spec.rb
|
@@ -318,6 +212,7 @@ test_files:
|
|
318
212
|
- spec/models/easy-resources/redmine/redmine_base_spec.rb
|
319
213
|
- spec/models/easy-resources/redmine/easy_web_application_activity_spec.rb
|
320
214
|
- spec/models/easy-resources/redmine/easy_web_application_spec.rb
|
215
|
+
- spec/models/easy-resources/redmine/user_spec.rb
|
321
216
|
- spec/models/easy-resources/resource_spec.rb
|
322
217
|
- spec/support/active_resource.rb
|
323
218
|
- spec/support/fixtures.rb
|
@@ -328,6 +223,7 @@ test_files:
|
|
328
223
|
- spec/fixtures/files/easy_crm_case/show.xml
|
329
224
|
- spec/fixtures/files/project.json
|
330
225
|
- spec/fixtures/files/issue.json
|
226
|
+
- spec/fixtures/files/user/show.xml
|
331
227
|
- spec/fixtures/files/project/show.xml
|
332
228
|
- spec/fixtures/files/issue/show.xml
|
333
229
|
- spec/fixtures/files/easy_contact.json
|
data/spec/dummy/Rakefile
DELETED
@@ -1,15 +0,0 @@
|
|
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. JavaScript code in this file should be added after the last require_* statement.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require rails-ujs
|
14
|
-
//= require activestorage
|
15
|
-
//= require_tree .
|
@@ -1,13 +0,0 @@
|
|
1
|
-
// Action Cable provides the framework to deal with WebSockets in Rails.
|
2
|
-
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
|
3
|
-
//
|
4
|
-
//= require action_cable
|
5
|
-
//= require_self
|
6
|
-
//= require_tree ./channels
|
7
|
-
|
8
|
-
(function() {
|
9
|
-
this.App || (this.App = {});
|
10
|
-
|
11
|
-
App.cable = ActionCable.createConsumer();
|
12
|
-
|
13
|
-
}).call(this);
|
@@ -1,15 +0,0 @@
|
|
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 other CSS/SCSS
|
10
|
-
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
-
* It is generally better to create a new file per style scope.
|
12
|
-
*
|
13
|
-
*= require_tree .
|
14
|
-
*= require_self
|
15
|
-
*/
|