chino_ruby 1.3 → 3.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8d1c62e512a7897b9713886fcbaee4c0a9169fb5
4
- data.tar.gz: 6d33cb278c707692b5a83b6d4ee1dc1eb54b5e85
2
+ SHA256:
3
+ metadata.gz: 51b775f64964eaffe94506e3beec1b415ec35987592b52b8a9edfa9f331636ba
4
+ data.tar.gz: 3d08cc1f363ac493d36e6131c321c47155635a28d74e94fe791d343eb7b5fa48
5
5
  SHA512:
6
- metadata.gz: e5ed066a83f1f64157c3e2da96a2f2b55e2a5ba4667b74c7d4015592faa2947d19f048b792887d1c0c114a6ba5f8fa229b5f8876f29dab5f3aeafa4b7c13718f
7
- data.tar.gz: 006a246794d3a4888c7b0b7f79437bbf221453f1b1e4c28a5f793ee812a7260a6dc949e39764e5a5670135f3446d84fe2491e52682aad6bdbc5163cef9768325
6
+ metadata.gz: 91ea8ed7b3d6ed1d268a7c05e568902b4b4563c171ec2c591617c72263196c9fcd6550868be8b0b285fa35e3224e9c1e175f413ec29028996b909e3c1fb1ba98
7
+ data.tar.gz: 943fd4f8f3b65175bd379fbae04dcdb2b52669f3df34d5f9cf80e80cd3438be554804889f7db63c3ba518d98a3fcef4fab6aa49c57454437f8078f5344e23b7e
data/.gitignore CHANGED
@@ -1,28 +1,30 @@
1
- # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
- #
3
- # If you find yourself ignoring temporary files generated by your text editor
4
- # or operating system, you probably want to add a global ignore instead:
5
- # git config --global core.excludesfile '~/.gitignore_global'
6
-
7
- # Ignore bundler config.
8
- /.bundle
9
-
10
- # Ignore the default SQLite database.
11
- /db/*.sqlite3
12
- /db/*.sqlite3-journal
13
-
14
- # Ignore all logfiles and tempfiles.
15
- /log/*
16
- /tmp/*
17
- !/log/.keep
18
- !/tmp/.keep
19
-
20
- /node_modules
21
- /yarn-error.log
22
-
23
- .byebug_history
24
- .DS_Store
25
- *.gem
26
- pkg/
27
- .idea/
28
- config-chino.yml
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*
16
+ /tmp/*
17
+ !/log/.keep
18
+ !/tmp/.keep
19
+
20
+ /node_modules
21
+ /yarn-error.log
22
+
23
+ .byebug_history
24
+ .DS_Store
25
+ *.gem
26
+ pkg/
27
+ .idea/
28
+ config-chino.yml
29
+ test/testfiles/output/Chino.io-eBook-Health-App-Compliance.pdf
30
+ test/test/testfiles/output/Chino.io-eBook-Health-App-Compliance.pdf
data/.rubocop.yml ADDED
@@ -0,0 +1,149 @@
1
+ AllCops:
2
+ TargetRubyVersion:
3
+ '2.2.3'
4
+ Include:
5
+ - Rakefile
6
+ - config.ru
7
+ - lib/**/*.rake
8
+ Exclude:
9
+ - db/schema.rb
10
+ - db/migrate/*.*
11
+ - Gemfile
12
+ - Capfile
13
+ - tmp/**/*.*
14
+
15
+ Bundler/OrderedGems:
16
+ Enabled: false
17
+
18
+ Style/AsciiComments:
19
+ Enabled: false
20
+
21
+ Style/RedundantSelf:
22
+ Enabled: false
23
+
24
+ Style/RedundantReturn:
25
+ Enabled: false
26
+
27
+ Style/Documentation:
28
+ Enabled: false
29
+
30
+ Style/FrozenStringLiteralComment:
31
+ Enabled: false
32
+
33
+ Style/SafeNavigation:
34
+ Enabled: false
35
+
36
+ Style/GuardClause:
37
+ Enabled: false
38
+
39
+ Style/NumericPredicate:
40
+ Enabled: false
41
+
42
+ Style/NegatedIf:
43
+ Enabled: false
44
+
45
+ Style/SymbolArray:
46
+ EnforcedStyle: brackets
47
+
48
+ Style/WordArray:
49
+ EnforcedStyle: brackets
50
+
51
+ Style/MethodDefParentheses:
52
+ Enabled: false
53
+
54
+ Style/RescueModifier:
55
+ Enabled: false
56
+
57
+ Style/BlockDelimiters:
58
+ Enabled: false
59
+
60
+ Style/WordArray:
61
+ Enabled: false
62
+
63
+ Style/SymbolArray:
64
+ Enabled: false
65
+
66
+ Style/ConditionalAssignment:
67
+ Enabled: false
68
+
69
+ Style/SingleLineMethods:
70
+ Enabled: false
71
+
72
+ Style/Next:
73
+ Enabled: false
74
+
75
+ Metrics/LineLength:
76
+ Enabled: false
77
+ Max: 80
78
+
79
+ Metrics/ClassLength:
80
+ Max: 1000
81
+
82
+ Metrics/ModuleLength:
83
+ Max: 1000
84
+
85
+ Metrics/MethodLength:
86
+ Max: 100
87
+
88
+ Metrics/AbcSize:
89
+ Enabled: false
90
+
91
+ Metrics/CyclomaticComplexity:
92
+ Max: 15
93
+
94
+ Metrics/PerceivedComplexity:
95
+ Max: 20
96
+
97
+ Metrics/BlockLength:
98
+ Max: 100
99
+
100
+ # SupportedStyles: empty_lines, no_empty_lines
101
+ Layout/EmptyLinesAroundBlockBody:
102
+ EnforcedStyle: no_empty_lines
103
+
104
+ # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
105
+ Layout/EmptyLinesAroundClassBody:
106
+ EnforcedStyle: no_empty_lines
107
+
108
+ # # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
109
+ # Layout/EmptyLinesAroundModuleBody:
110
+ # Enabled: false
111
+
112
+ # Configuration parameters: SupportedStyles, IndentationWidth.
113
+ # SupportedStyles: special_inside_parentheses, consistent, align_brackets
114
+ Layout/IndentArray:
115
+ EnforcedStyle: consistent
116
+
117
+ # # Configuration parameters: AllowAdjacentOneLineDefs, NumberOfEmptyLines.
118
+ # Layout/EmptyLineBetweenDefs:
119
+ # Enabled: false
120
+
121
+ # # Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
122
+ # Layout/ExtraSpacing:
123
+ # Enabled: false
124
+
125
+ Layout/IndentHash:
126
+ EnforcedStyle: consistent
127
+
128
+ Layout/IndentationConsistency:
129
+ EnforcedStyle: rails
130
+
131
+ Layout/LeadingCommentSpace:
132
+ Enabled: false
133
+
134
+ Layout/MultilineMethodCallIndentation:
135
+ EnforcedStyle: indented
136
+
137
+ Layout/MultilineOperationIndentation:
138
+ EnforcedStyle: indented
139
+
140
+ Layout/AlignParameters:
141
+ Enabled: false
142
+
143
+ # http://ruby-doc.org/core-2.4.0/String.html#method-i-casecmp-3F
144
+ # twice as fast but harder to read
145
+ Performance/Casecmp:
146
+ Enabled: false
147
+
148
+ Lint/NonLocalExitFromIterator:
149
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,29 @@
1
+ # Changelog
2
+
3
+ ## [next release date] - next release
4
+
5
+
6
+
7
+ ## [2020-02-01] - v 3.0.0
8
+ - Migrated code from GitHub
9
+ - Changed behaviour of `update_user_partial` from
10
+
11
+ def update_user_partial(user_id, attributes)
12
+
13
+ to
14
+
15
+ def update_user_partial(user_id, attributes=nil, username=nil, password=nil)
16
+
17
+ which allows to only specify username, password or a set of attributes.
18
+
19
+ Now it is possible to update username and password of the users too.
20
+
21
+ On top of that, the `attributes` have been correctly wrapped in order to match the
22
+ request described in the
23
+ [Chino.io API docs](https://console.test.chino.io/docs/v1#users-user-object-patch)
24
+
25
+ - Raise a `ChinoAuthException` when receiving a `400` response that contains:
26
+ `"message": "Invalid credentials given."`
27
+
28
+ - fix path in BLOB test so it can be invoked both from folder `test/` and from
29
+ the repository base folder
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,17 @@
1
+ # Contributing
2
+ For suggestions, improvements or bug fixes please follow these steps:
3
+
4
+ - fork the repository
5
+
6
+ - run `bin/setup` to install dependencies.
7
+
8
+ You can also run `bin/console` for an interactive prompt that will allow
9
+ you to experiment.
10
+
11
+ - develop. If you are adding new logic, **write tests** for it.
12
+
13
+ - launch tests - :warning: **be careful!**:
14
+
15
+ > the tests will **delete EVERYTHING stored in the account** in order to preserve the correctness of the tests. Run them on a custom account and always against the test API `https://api.test.chino.io`.
16
+
17
+ - create a Merge Request to the original repository.
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec
4
-
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
data/Gemfile.lock CHANGED
@@ -1,134 +1,37 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- chino_ruby (1.3)
5
- listen (~> 3.0)
6
- rails (~> 5.1, >= 5.1.1)
4
+ chino_ruby (3.0.0)
5
+ activemodel (~> 5.0)
7
6
 
8
7
  GEM
9
8
  remote: https://rubygems.org/
10
9
  specs:
11
- actioncable (5.1.2)
12
- actionpack (= 5.1.2)
13
- nio4r (~> 2.0)
14
- websocket-driver (~> 0.6.1)
15
- actionmailer (5.1.2)
16
- actionpack (= 5.1.2)
17
- actionview (= 5.1.2)
18
- activejob (= 5.1.2)
19
- mail (~> 2.5, >= 2.5.4)
20
- rails-dom-testing (~> 2.0)
21
- actionpack (5.1.2)
22
- actionview (= 5.1.2)
23
- activesupport (= 5.1.2)
24
- rack (~> 2.0)
25
- rack-test (~> 0.6.3)
26
- rails-dom-testing (~> 2.0)
27
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
- actionview (5.1.2)
29
- activesupport (= 5.1.2)
30
- builder (~> 3.1)
31
- erubi (~> 1.4)
32
- rails-dom-testing (~> 2.0)
33
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
34
- activejob (5.1.2)
35
- activesupport (= 5.1.2)
36
- globalid (>= 0.3.6)
37
- activemodel (5.1.2)
38
- activesupport (= 5.1.2)
39
- activerecord (5.1.2)
40
- activemodel (= 5.1.2)
41
- activesupport (= 5.1.2)
42
- arel (~> 8.0)
43
- activesupport (5.1.2)
10
+ activemodel (5.2.4.1)
11
+ activesupport (= 5.2.4.1)
12
+ activesupport (5.2.4.1)
44
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
45
- i18n (~> 0.7)
14
+ i18n (>= 0.7, < 2)
46
15
  minitest (~> 5.1)
47
16
  tzinfo (~> 1.1)
48
- arel (8.0.0)
49
- builder (3.2.3)
50
- concurrent-ruby (1.0.5)
51
- erubi (1.6.1)
52
- ffi (1.9.18)
53
- globalid (0.4.0)
54
- activesupport (>= 4.2.0)
55
- i18n (0.8.4)
56
- listen (3.1.5)
57
- rb-fsevent (~> 0.9, >= 0.9.4)
58
- rb-inotify (~> 0.9, >= 0.9.7)
59
- ruby_dep (~> 1.2)
60
- loofah (2.0.3)
61
- nokogiri (>= 1.5.9)
62
- mail (2.6.6)
63
- mime-types (>= 1.16, < 4)
64
- method_source (0.8.2)
65
- mime-types (3.1)
66
- mime-types-data (~> 3.2015)
67
- mime-types-data (3.2016.0521)
68
- mini_portile2 (2.2.0)
69
- minitest (5.10.2)
70
- nio4r (2.1.0)
71
- nokogiri (1.8.0)
72
- mini_portile2 (~> 2.2.0)
73
- power_assert (1.0.2)
74
- rack (2.0.3)
75
- rack-test (0.6.3)
76
- rack (>= 1.0)
77
- rails (5.1.2)
78
- actioncable (= 5.1.2)
79
- actionmailer (= 5.1.2)
80
- actionpack (= 5.1.2)
81
- actionview (= 5.1.2)
82
- activejob (= 5.1.2)
83
- activemodel (= 5.1.2)
84
- activerecord (= 5.1.2)
85
- activesupport (= 5.1.2)
86
- bundler (>= 1.3.0, < 2.0)
87
- railties (= 5.1.2)
88
- sprockets-rails (>= 2.0.0)
89
- rails-dom-testing (2.0.3)
90
- activesupport (>= 4.2.0)
91
- nokogiri (>= 1.6)
92
- rails-html-sanitizer (1.0.3)
93
- loofah (~> 2.0)
94
- railties (5.1.2)
95
- actionpack (= 5.1.2)
96
- activesupport (= 5.1.2)
97
- method_source
98
- rake (>= 0.8.7)
99
- thor (>= 0.18.1, < 2.0)
100
- rake (12.0.0)
101
- rb-fsevent (0.10.2)
102
- rb-inotify (0.9.10)
103
- ffi (>= 0.5.0, < 2)
104
- ruby_dep (1.5.0)
105
- spring (0.9.2)
106
- sprockets (3.7.1)
17
+ concurrent-ruby (1.1.5)
18
+ i18n (1.8.2)
107
19
  concurrent-ruby (~> 1.0)
108
- rack (> 1, < 3)
109
- sprockets-rails (3.2.0)
110
- actionpack (>= 4.0)
111
- activesupport (>= 4.0)
112
- sprockets (>= 3.0.0)
20
+ minitest (5.14.0)
21
+ power_assert (1.0.2)
113
22
  test-unit (3.1.9)
114
23
  power_assert
115
- thor (0.19.4)
116
24
  thread_safe (0.3.6)
117
- tzinfo (1.2.3)
25
+ tzinfo (1.2.6)
118
26
  thread_safe (~> 0.1)
119
- websocket-driver (0.6.5)
120
- websocket-extensions (>= 0.1.0)
121
- websocket-extensions (0.1.2)
122
27
 
123
28
  PLATFORMS
124
29
  ruby
30
+ x64-mingw32
125
31
 
126
32
  DEPENDENCIES
127
- bundler (~> 1.15)
128
33
  chino_ruby!
129
- rake (~> 12.0.0)
130
- spring (~> 0)
131
- test-unit (~> 3.1.2)
34
+ test-unit (~> 3.1)
132
35
 
133
36
  BUNDLED WITH
134
- 1.15.1
37
+ 2.1.4
data/INSTRUCTIONS.md ADDED
@@ -0,0 +1,61 @@
1
+ # [COMMUNITY] Chino Ruby SDK <!-- omit in toc -->
2
+
3
+ Ruby SDK for Chino.io API
4
+
5
+ **Community SDK:** Most of the content and the code has been provided
6
+ by third-parties.
7
+
8
+ For issues or questions, please contact [tech-support@chino.io](mailto:tech-support@chino.io).
9
+
10
+ -------------------------------------------------------------------------------
11
+ #### Table of content <!-- omit in toc -->
12
+ - [Installation and setup](#installation-and-setup)
13
+ - [SDK usage](#sdk-usage)
14
+ - [Development](#development)
15
+ - [Running the tests](#running-the-tests)
16
+ - [License](#license)
17
+
18
+ -------------------------------------------------------------------------------
19
+
20
+ ## Installation and setup
21
+
22
+ Please refer to [README.md](./README.md#requirements)
23
+
24
+ ## SDK usage
25
+
26
+ *Read the [full API docs](https://console.test.chino.io/docs/v1)*
27
+
28
+ For usage details and a basic example, please refer to
29
+ [README.md](./README.md#usage)
30
+
31
+ ## Development
32
+ Some useful commands to use for local development.
33
+ See also [CONTRIBUTING.md](./CONTRIBUTING.md)
34
+
35
+ ### Install locally <!-- omit in toc -->
36
+
37
+ bundle exec rake install
38
+
39
+ ### Running the tests
40
+ You have to run the following commands in the terminal in order to
41
+ run the tests:
42
+
43
+ bundle install
44
+ cd test # optional since version 3.0.0
45
+ bundle exec ruby sdk_test.rb
46
+
47
+ ### Release a new version (mostly for internal use) <!-- omit in toc -->
48
+
49
+ - update the version number in `version.rb`
50
+ - run
51
+
52
+ bundle exec rake release
53
+
54
+ This will create a git tag for the version.
55
+ - push git commits and tags
56
+ - push the `.gem` file to [rubygems.org](https://rubygems.org)
57
+
58
+ ## License
59
+
60
+ The gem is available as open source under the terms of the
61
+ [MIT License](http://opensource.org/licenses/MIT).