freckle_io 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.codeclimate.yml +5 -0
- data/.env.sample +3 -0
- data/.env.test.sample +3 -0
- data/.gitignore +5 -0
- data/.rubocop.yml +67 -0
- data/.travis.yml +20 -0
- data/Gemfile +8 -0
- data/README.md +95 -0
- data/Rakefile +5 -0
- data/freckle-io.gemspec +37 -0
- data/icon.svg +192 -0
- data/lib/freckle_io/authentication.rb +26 -0
- data/lib/freckle_io/client/entries.rb +53 -0
- data/lib/freckle_io/client/project_groups.rb +36 -0
- data/lib/freckle_io/client/projects.rb +42 -0
- data/lib/freckle_io/client/tags.rb +33 -0
- data/lib/freckle_io/client/users.rb +35 -0
- data/lib/freckle_io/configuration.rb +48 -0
- data/lib/freckle_io/connection.rb +80 -0
- data/lib/freckle_io/errors/configuration.rb +5 -0
- data/lib/freckle_io/errors/connection.rb +9 -0
- data/lib/freckle_io/errors/params.rb +8 -0
- data/lib/freckle_io/paginator.rb +70 -0
- data/lib/freckle_io/params.rb +46 -0
- data/lib/freckle_io/request/multiple_pages.rb +62 -0
- data/lib/freckle_io/request/single_page.rb +73 -0
- data/lib/freckle_io/validator/entry.rb +57 -0
- data/lib/freckle_io/validator/project.rb +46 -0
- data/lib/freckle_io/validator/project_group.rb +30 -0
- data/lib/freckle_io/validator/restricted_hash.rb +11 -0
- data/lib/freckle_io/validator/tag.rb +30 -0
- data/lib/freckle_io/validator/user.rb +43 -0
- data/lib/freckle_io/validator/validation.yml +14 -0
- data/lib/freckle_io.rb +35 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Entries/with_configuration/_all/result_must_be_a_Request_MultiplePages.yml +48 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Entries/with_configuration/_all/returns_a_entry_for_each_response.yml +48 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Entries/with_configuration/with_valid_params/params_should_be_valid.yml +48 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Entries/with_configuration/with_validator/call_entry_s_validator.yml +48 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_ProjectGroups/with_configuration/_all/result_must_be_a_Request_MultiplePages.yml +99 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_ProjectGroups/with_configuration/_all/returns_a_project_group_for_each_response.yml +99 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_ProjectGroups/with_configuration/with_valid_params/params_should_be_valid.yml +48 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_ProjectGroups/with_configuration/with_validator/call_project_group_s_validator.yml +99 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Projects/with_configuration/_all/result_must_be_a_Request_MultiplePages.yml +491 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Projects/with_configuration/_all/returns_a_project_for_each_response.yml +491 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Projects/with_configuration/_show/get_a_spacific_project.yml +48 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Projects/with_configuration/_show/raw_links_should_be_a_empty_array.yml +48 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Projects/with_configuration/with_valid_params/params_should_be_valid.yml +48 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Projects/with_configuration/with_validator/call_project_s_validator.yml +491 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Tags/with_configuration/_all/result_must_be_a_Request_MultiplePages.yml +48 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Tags/with_configuration/_all/returns_a_tag_for_each_response.yml +48 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Tags/with_configuration/with_valid_params/params_should_be_valid.yml +48 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Tags/with_configuration/with_validator/call_tag_s_validator.yml +48 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Users/with_configuration/_all/result_must_be_a_Request_MultiplePages.yml +99 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Users/with_configuration/_all/returns_a_user_for_each_response.yml +99 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Users/with_configuration/_show/get_a_spacific_user.yml +48 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Users/with_configuration/_show/raw_links_should_be_a_empty_array.yml +48 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Users/with_configuration/with_valid_params/params_should_be_valid.yml +48 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Client_Users/with_configuration/with_validator/call_user_s_validator.yml +99 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Connection/with_default_configuration/with_a_valid_response/must_be_a_json_format.yml +51 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Connection/with_default_configuration/with_freckle_token_authentication/set_X-FreckleToken.yml +51 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Connection/with_default_configuration/with_header/set_user_agent.yml +51 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Connection/with_default_configuration/with_invalid_url/raises_a_resource_not_found_error_for_invalid_resource.yml +40 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Connection/with_default_configuration/with_page_param/response_must_be_success.yml +51 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Connection/with_default_configuration/with_per_page_param/response_must_have_per_page_elements.yml +51 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Request_MultiplePages/with_configuration/_get/returns_an_array_of_faraday_response.yml +99 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Request_MultiplePages/with_configuration/_get/returns_freckle_default_per_page_elements.yml +99 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Request_MultiplePages/with_per_page/_get/return_per_page_number_elements.yml +148 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Request_SinglePage/with_configuration/_first/next_page_should_be_a_SinglePage.yml +99 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Request_SinglePage/with_configuration/_first/prev_page_should_be_nil.yml +51 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Request_SinglePage/with_configuration/_first/when_get_last_page_from_the_first_page/next_should_be_nil.yml +99 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Request_SinglePage/with_configuration/_get/returns_correct_raw_links_for_the_first_page.yml +51 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Request_SinglePage/with_configuration/_last/next_page_should_be_nil.yml +99 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Request_SinglePage/with_configuration/_last/returns_correct_raw_links_for_the_last_page.yml +99 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Request_SinglePage/with_configuration/_last/when_get_prev_page_from_the_last_page/prev_should_be_nil.yml +147 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Request_SinglePage/with_configuration/_next/previous_page_is_a_SinglePage.yml +147 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Request_SinglePage/with_configuration/_next/previous_page_should_be_not_nil.yml +147 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Request_SinglePage/with_configuration/_prev/next_page_is_a_SinglePage.yml +195 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Request_SinglePage/with_configuration/_prev/when_get_prev_page_from_the_first_page/prev_should_be_nil.yml +147 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Request_SinglePage/with_configuration/_total_page/with_first_page/returns_the_range_of_pages.yml +51 -0
- data/spec/fixtures/vcr_cassettes/FreckleIO_Request_SinglePage/with_configuration/_total_page/with_next_page/returns_an_empty_array.yml +99 -0
- data/spec/freckle_io/client/entries_spec.rb +359 -0
- data/spec/freckle_io/client/project_groups_spec.rb +132 -0
- data/spec/freckle_io/client/projects_spec.rb +183 -0
- data/spec/freckle_io/client/tags_spec.rb +132 -0
- data/spec/freckle_io/client/users_spec.rb +150 -0
- data/spec/freckle_io/configuration_spec.rb +70 -0
- data/spec/freckle_io/connection_spec.rb +116 -0
- data/spec/freckle_io/paginator_spec.rb +105 -0
- data/spec/freckle_io/params_spec.rb +15 -0
- data/spec/freckle_io/request/multiple_pages_spec.rb +39 -0
- data/spec/freckle_io/request/single_page_spec.rb +107 -0
- data/spec/spec_helper.rb +69 -0
- data/spec/support/anonymize/entries.rb +60 -0
- data/spec/support/anonymize/project_groups.rb +55 -0
- data/spec/support/anonymize/projects.rb +60 -0
- data/spec/support/anonymize/tags.rb +47 -0
- data/spec/support/anonymize/users.rb +59 -0
- data/spec/support/anonymize_interaction.rb +60 -0
- data/spec/support/entry_info.rb +19 -0
- data/spec/support/project_group_info.rb +13 -0
- data/spec/support/project_info.rb +26 -0
- data/spec/support/shared/links/raw_links.rb +13 -0
- data/spec/support/tag_info.rb +11 -0
- data/spec/support/user_info.rb +21 -0
- metadata +382 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://foo.com/6
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- MyFreckleBot/1.0
|
12
|
+
X-Freckletoken:
|
13
|
+
- "<TOKEN>"
|
14
|
+
Expect:
|
15
|
+
- ''
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Server:
|
22
|
+
- nginx
|
23
|
+
Date:
|
24
|
+
- Mon, 10 Dec 2018 17:23:57 GMT
|
25
|
+
Content-Type:
|
26
|
+
- application/json; charset=utf-8
|
27
|
+
Content-Length:
|
28
|
+
- '2074'
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
Status:
|
32
|
+
- 200 OK
|
33
|
+
Cache-Control:
|
34
|
+
- private, max-age=0, must-revalidate
|
35
|
+
X-Frame-Options:
|
36
|
+
- SAMEORIGIN
|
37
|
+
X-Runtime:
|
38
|
+
- '68'
|
39
|
+
Vary:
|
40
|
+
- Origin
|
41
|
+
Strict-Transport-Security:
|
42
|
+
- max-age=31536000; includeSubdomains
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: '{"id":0,"name":"name_0","description":"","billing_increment":5,"enabled":true,"billable":true,"color":"#13a480","created_at":"2018-07-16T08:32:45Z","updated_at":"2018-12-04T16:45:07Z","group":{"id":1,"name":"name_1","url":"http://foo.com/0"},"minutes":8430,"billable_minutes":6270,"unbillable_minutes":2160,"invoiced_minutes":0,"uninvoiced_minutes":6270,"remaining_minutes":8730,"budgeted_minutes":15000,"participants":[{"id":2,"email":"email_0@domain.com","first_name":"first_name_0","last_name":"last_name_0","profile_image_url":"http://foo.com/0","url":"http://foo.com/1"},{"id":3,"email":"email_1@domain.com","first_name":"first_name_1","last_name":"last_name_1","profile_image_url":"http://foo.com/1","url":"http://foo.com/2"},{"id":4,"email":"email_2@domain.com","first_name":"first_name_2","last_name":"last_name_2","profile_image_url":"http://foo.com/2","url":"http://foo.com/3"},{"id":5,"email":"email_3@domain.com","first_name":"first_name_3","last_name":"last_name_3","profile_image_url":"http://foo.com/3","url":"http://foo.com/4"},{"id":6,"email":"email_4@domain.com","first_name":"first_name_4","last_name":"last_name_4","profile_image_url":"","url":"http://foo.com/5"}],"entries":36,"entries_url":"http://foo.com/6/entries","url":"http://foo.com/6","merge_url":"http://foo.com/6/merge","archive_url":"http://foo.com/6/archive","unarchive_url":"http://foo.com/6/unarchive"}'
|
46
|
+
http_version:
|
47
|
+
recorded_at: Mon, 10 Dec 2018 17:23:57 GMT
|
48
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://foo.com/6
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- MyFreckleBot/1.0
|
12
|
+
X-Freckletoken:
|
13
|
+
- "<TOKEN>"
|
14
|
+
Expect:
|
15
|
+
- ''
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Server:
|
22
|
+
- nginx
|
23
|
+
Date:
|
24
|
+
- Mon, 10 Dec 2018 17:23:57 GMT
|
25
|
+
Content-Type:
|
26
|
+
- application/json; charset=utf-8
|
27
|
+
Content-Length:
|
28
|
+
- '2074'
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
Status:
|
32
|
+
- 200 OK
|
33
|
+
Cache-Control:
|
34
|
+
- private, max-age=0, must-revalidate
|
35
|
+
X-Frame-Options:
|
36
|
+
- SAMEORIGIN
|
37
|
+
X-Runtime:
|
38
|
+
- '62'
|
39
|
+
Vary:
|
40
|
+
- Origin
|
41
|
+
Strict-Transport-Security:
|
42
|
+
- max-age=31536000; includeSubdomains
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: '{"id":0,"name":"name_0","description":"","billing_increment":5,"enabled":true,"billable":true,"color":"#13a480","created_at":"2018-07-16T08:32:45Z","updated_at":"2018-12-04T16:45:07Z","group":{"id":1,"name":"name_1","url":"http://foo.com/0"},"minutes":8430,"billable_minutes":6270,"unbillable_minutes":2160,"invoiced_minutes":0,"uninvoiced_minutes":6270,"remaining_minutes":8730,"budgeted_minutes":15000,"participants":[{"id":2,"email":"email_0@domain.com","first_name":"first_name_0","last_name":"last_name_0","profile_image_url":"http://foo.com/0","url":"http://foo.com/1"},{"id":3,"email":"email_1@domain.com","first_name":"first_name_1","last_name":"last_name_1","profile_image_url":"http://foo.com/1","url":"http://foo.com/2"},{"id":4,"email":"email_2@domain.com","first_name":"first_name_2","last_name":"last_name_2","profile_image_url":"http://foo.com/2","url":"http://foo.com/3"},{"id":5,"email":"email_3@domain.com","first_name":"first_name_3","last_name":"last_name_3","profile_image_url":"http://foo.com/3","url":"http://foo.com/4"},{"id":6,"email":"email_4@domain.com","first_name":"first_name_4","last_name":"last_name_4","profile_image_url":"","url":"http://foo.com/5"}],"entries":36,"entries_url":"http://foo.com/6/entries","url":"http://foo.com/6","merge_url":"http://foo.com/6/merge","archive_url":"http://foo.com/6/archive","unarchive_url":"http://foo.com/6/unarchive"}'
|
46
|
+
http_version:
|
47
|
+
recorded_at: Mon, 10 Dec 2018 17:23:57 GMT
|
48
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.letsfreckle.com/v2/projects?billable=true&billing_increment=1&enabled=true&name=valid_string&per_page=30&project_group_ids=1
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- MyFreckleBot/1.0
|
12
|
+
X-Freckletoken:
|
13
|
+
- "<TOKEN>"
|
14
|
+
Expect:
|
15
|
+
- ''
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Server:
|
22
|
+
- nginx
|
23
|
+
Date:
|
24
|
+
- Mon, 10 Dec 2018 17:23:58 GMT
|
25
|
+
Content-Type:
|
26
|
+
- application/json; charset=utf-8
|
27
|
+
Content-Length:
|
28
|
+
- '2'
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
Status:
|
32
|
+
- 200 OK
|
33
|
+
Cache-Control:
|
34
|
+
- private, max-age=0, must-revalidate
|
35
|
+
X-Frame-Options:
|
36
|
+
- SAMEORIGIN
|
37
|
+
X-Runtime:
|
38
|
+
- '40'
|
39
|
+
Vary:
|
40
|
+
- Origin
|
41
|
+
Strict-Transport-Security:
|
42
|
+
- max-age=31536000; includeSubdomains
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: "[]"
|
46
|
+
http_version:
|
47
|
+
recorded_at: Mon, 10 Dec 2018 17:23:58 GMT
|
48
|
+
recorded_with: VCR 4.0.0
|