coda_docs 0.1.1 → 1.0.1

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
2
  SHA256:
3
- metadata.gz: 349dfdb535df5c37de23f6bd211110cd387ade44fe2684e0b1a2422e972230a1
4
- data.tar.gz: 9a057b1994d31a11cc8cfb30071dea4374739f4861c4db068633ac3b623e68d2
3
+ metadata.gz: b6c86d0f9b3f01c8d4c676832e3d3184f0d5574beb7718d58a2a8fd92f8226ac
4
+ data.tar.gz: 6df83a22d5323097e7403af15b54105cd9823e8e69ffd9476ecc1a6456ee4f62
5
5
  SHA512:
6
- metadata.gz: e1b69a52a9a775f938262d99a4617234a66abe5d106ce95934ad04381f44c7d7bbf141179e7659d30b771247b8e36cd951832c3e43d907ed448fc77a5ac975ee
7
- data.tar.gz: 0f6c59f5434fdfecd5f36ea5f20c899d06158606fe4ed9affba310ef634bcbd6680fc929013391b8f7b2129d88c3be362a7067e166f9fe5bc8b9cfe666ed0f2f
6
+ metadata.gz: e50493d68a522e10bbe4b59ed0333506ae25dc81d4548bc842a97a1ac9b4de7900bc0701d7d03985ad13a94862366272abf154e3d960a7ae8db7f9438e6d8474
7
+ data.tar.gz: 40f00dd2fcd119e05cded8bdb80475b0674812ae88afebaa8c197ed12baf82c0dbe045b60956039351108e49b1f83028ff300f3ea90c20213c47030cefeeb05a
@@ -0,0 +1,19 @@
1
+ ---
2
+ version: "2"
3
+ checks:
4
+ method-complexity:
5
+ config:
6
+ threshold: 6
7
+ exclude_patterns:
8
+ - .bundle/
9
+ - spec/**/*
10
+ - benchmarks/**/*
11
+
12
+ - bin/
13
+ - ".*"
14
+ - "*.json"
15
+ - "*.ru"
16
+ - "*.sh"
17
+ - "*.yml"
18
+ - "*.md"
19
+ - "*file*"
data/.gitignore CHANGED
@@ -1,5 +1,8 @@
1
1
  *.gem
2
2
  *.rbc
3
+ .ruby-version
4
+ .byebug_history
5
+ .rspec_status
3
6
  /.config
4
7
  /coverage/
5
8
  /InstalledFiles
@@ -1,6 +1,6 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.3
3
- Excludes:
2
+ TargetRubyVersion: 2.4
3
+ Exclude:
4
4
  - app/admin/*.rb
5
5
  - db/migrate/*.rb
6
6
 
@@ -1,7 +1,16 @@
1
- ---
2
1
  sudo: false
3
2
  language: ruby
4
- cache: bundler
5
3
  rvm:
6
- - 2.5.3
7
- before_install: gem install bundler -v 1.16.6
4
+ - 2.4
5
+ - 2.5
6
+ - 2.6
7
+ before_install:
8
+ - gem install bundler -v '< 2'
9
+ cache: bundler
10
+ deploy:
11
+ provider: rubygems
12
+ api_key:
13
+ secure: C9e6OluEe/RMUFY6JDmw5HLoXMiD4w+Gu5yGLyLF4UezkKdyy08y4z1HqooKYR33ePf65tn1EMgQf+2yTJgnh6FLWGe6Kn77+5NozSUqD/LdFeHG3+qq8VQR2fZv5Lf0j433Yyl5if9NOvpTxaVEjtyPZ45ykDoRCz+d1meXDQeEjp8KloBHcJXIWtvSp4nylS34TU+fUaYiiLEPluqIFyrpjHhXQgKb6JuShKZ48/0qRIWcAYeMbrx3ppOZDov41yrkK6XbkKqCPbr+CC9BSX8ObE/kJf68od2XfNH39pgLgp+uxTuGOciZNHfRLbWIxq1PV6or2MB6t19pkLpPzcBkSc3PZopjBCxmXhEOEsDllCTOXwbWcqJj/QB6oQKXLhnVN5I5n84POXKSUmQ/dfZYFnU5surHxMrZBA31QJhS0DImpCsUmY8oo4dJzmN0Iu8WkWUD5myXh8KQ9rJ/jLxlFofcefOz0dfTIvHUrT2D3UBWOfHu0KP0q2JLzMRv0LFS0brvV4hQDxjJJtMMLOj8mmX3dO7iIT33mBVPiO/XiIl/ItZbO5W5rh0iJVLZBTJnyqS4i1m1vkV/MHCR6fl5zGroySaRO2Eg2m1azVT1k/lVSW0pBt4oB70isU3opxldi8LFz30MWhN5mIgtw4GO/TkYmAjV5AMEVb38C0E=
14
+ on:
15
+ tags: true
16
+ branch: master
data/Gemfile CHANGED
@@ -1,10 +1,16 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
3
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in coda_docs.gemspec
6
6
  gemspec
7
7
 
8
8
  group :test do
9
9
  gem 'rspec'
10
+ gem 'vcr'
11
+ gem 'webmock'
12
+ end
13
+
14
+ group :tools do
15
+ gem 'rubocop'
10
16
  end
@@ -1,41 +1,55 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- coda_docs (0.1.0)
4
+ coda_docs (1.0.1)
5
5
  activesupport
6
6
  httparty
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (5.2.1)
11
+ activesupport (6.0.3.2)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
13
  i18n (>= 0.7, < 2)
14
14
  minitest (~> 5.1)
15
15
  tzinfo (~> 1.1)
16
+ zeitwerk (~> 2.2, >= 2.2.2)
17
+ addressable (2.7.0)
18
+ public_suffix (>= 2.0.2, < 5.0)
19
+ ast (2.4.1)
16
20
  byebug (10.0.2)
17
21
  coderay (1.1.2)
18
- concurrent-ruby (1.1.3)
22
+ concurrent-ruby (1.1.7)
23
+ crack (0.4.3)
24
+ safe_yaml (~> 1.0.0)
19
25
  diff-lcs (1.3)
20
26
  dotenv (2.5.0)
21
- httparty (0.16.3)
27
+ hashdiff (1.0.0)
28
+ httparty (0.18.1)
22
29
  mime-types (~> 3.0)
23
30
  multi_xml (>= 0.5.2)
24
- i18n (1.1.1)
31
+ i18n (1.8.5)
25
32
  concurrent-ruby (~> 1.0)
26
33
  method_source (0.9.2)
27
- mime-types (3.2.2)
34
+ mime-types (3.3.1)
28
35
  mime-types-data (~> 3.2015)
29
- mime-types-data (3.2018.0812)
30
- minitest (5.11.3)
36
+ mime-types-data (3.2020.0512)
37
+ minitest (5.14.1)
31
38
  multi_xml (0.6.0)
39
+ parallel (1.19.1)
40
+ parser (2.7.1.4)
41
+ ast (~> 2.4.1)
32
42
  pry (0.12.2)
33
43
  coderay (~> 1.1.0)
34
44
  method_source (~> 0.9.0)
35
45
  pry-byebug (3.6.0)
36
46
  byebug (~> 10.0)
37
47
  pry (~> 0.10)
38
- rake (10.5.0)
48
+ public_suffix (4.0.2)
49
+ rainbow (3.0.0)
50
+ rake (13.0.1)
51
+ regexp_parser (1.7.1)
52
+ rexml (3.2.4)
39
53
  rspec (3.8.0)
40
54
  rspec-core (~> 3.8.0)
41
55
  rspec-expectations (~> 3.8.0)
@@ -49,21 +63,44 @@ GEM
49
63
  diff-lcs (>= 1.2.0, < 2.0)
50
64
  rspec-support (~> 3.8.0)
51
65
  rspec-support (3.8.0)
66
+ rubocop (0.89.1)
67
+ parallel (~> 1.10)
68
+ parser (>= 2.7.1.1)
69
+ rainbow (>= 2.2.2, < 4.0)
70
+ regexp_parser (>= 1.7)
71
+ rexml
72
+ rubocop-ast (>= 0.3.0, < 1.0)
73
+ ruby-progressbar (~> 1.7)
74
+ unicode-display_width (>= 1.4.0, < 2.0)
75
+ rubocop-ast (0.3.0)
76
+ parser (>= 2.7.1.4)
77
+ ruby-progressbar (1.10.1)
78
+ safe_yaml (1.0.5)
52
79
  thread_safe (0.3.6)
53
- tzinfo (1.2.5)
80
+ tzinfo (1.2.7)
54
81
  thread_safe (~> 0.1)
82
+ unicode-display_width (1.7.0)
83
+ vcr (5.0.0)
84
+ webmock (3.7.6)
85
+ addressable (>= 2.3.6)
86
+ crack (>= 0.3.2)
87
+ hashdiff (>= 0.4.0, < 2.0.0)
88
+ zeitwerk (2.4.0)
55
89
 
56
90
  PLATFORMS
57
91
  ruby
58
92
 
59
93
  DEPENDENCIES
60
- bundler (~> 1.16)
94
+ bundler
61
95
  coda_docs!
62
96
  dotenv (~> 2.5)
63
97
  pry
64
98
  pry-byebug
65
- rake (~> 10.0)
99
+ rake (~> 13.0)
66
100
  rspec
101
+ rubocop
102
+ vcr
103
+ webmock
67
104
 
68
105
  BUNDLED WITH
69
- 1.16.6
106
+ 2.1.4
data/README.md CHANGED
@@ -23,20 +23,21 @@ Or install it yourself as:
23
23
  The library needs to be configured with your account's secret key which is available in your [Coda Docs Dashboard](https://coda.io/account). You can set the required key with the `CODA_DOCS_API_KEY` environment variable
24
24
 
25
25
  ```ruby
26
- CODA_DOCS_API_KEY=Vau7FXe57Ith6MxcMnT1QSzNZ0o1YZ8s
26
+ CODA_DOCS_API_KEY=my_secret_key
27
27
 
28
28
  # New Coda Docs Client
29
29
  client = CodaDocs::Client.new
30
30
  ```
31
- or at the moment we create a new client.
31
+ or by instantiating a new client with your secret key.
32
32
 
33
33
  ```ruby
34
34
  require "coda_docs"
35
35
 
36
36
  # New Coda Docs Client
37
- client = CodaDocs::Client.new('Vau7FXe57Ith6MxcMnT1QSzNZ0o1YZ8s')
37
+ client = CodaDocs::Client.new(my_secret_key)
38
38
  ```
39
39
 
40
+ Click [here](https://github.com/cmunozgar/coda_docs/wiki) for more usage info.
40
41
  ## Development
41
42
 
42
43
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/Rakefile CHANGED
@@ -3,4 +3,10 @@ require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task default: :spec
6
+ task default: :spec
7
+
8
+ # To open up gem in pry mode during development
9
+ # Run rake console
10
+ task :console do
11
+ exec 'pry -r coda_docs -I ./lib'
12
+ end
@@ -1,7 +1,7 @@
1
- #!/usr/bin/env ruby
1
+ # !/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
- require "coda_docs"
3
+ require 'bundler/setup'
4
+ require 'coda_docs'
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +10,5 @@ require "coda_docs"
10
10
  # require "pry"
11
11
  # Pry.start
12
12
 
13
- require "irb"
13
+ require 'irb'
14
14
  IRB.start(__FILE__)
@@ -9,8 +9,9 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ['carlos@monday.vc']
10
10
 
11
11
  spec.summary = 'Coda Docs Api Gem'
12
- spec.description = 'Gem to help integrate Ruby <> Coda Docs API (0.1.1-beta). Work is still in progress and everything is subject to change.'
12
+ spec.description = 'Coda Docs Api Gem'
13
13
  spec.homepage = 'https://github.com/joinmonday/coda_docs'
14
+ spec.required_ruby_version = '>= 2.4'
14
15
 
15
16
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
16
17
  # to allow pushing to a single host or delete this section to allow pushing to any host.
@@ -33,11 +34,12 @@ Gem::Specification.new do |spec|
33
34
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
34
35
  spec.require_paths = ['lib']
35
36
 
36
- spec.add_development_dependency 'bundler', '~> 1.16'
37
+ spec.add_development_dependency 'bundler' # , '~> 1.16'
37
38
  spec.add_development_dependency 'dotenv', '~> 2.5'
38
- spec.add_development_dependency 'pry', '~> 0.12'
39
- spec.add_development_dependency 'pry-byebug', '~> 3.6'
40
- spec.add_development_dependency 'rake', '~> 10.0'
39
+ spec.add_development_dependency 'pry'
40
+ spec.add_development_dependency 'pry-byebug'
41
+ spec.add_development_dependency 'rake', '~> 13.0'
41
42
  spec.add_development_dependency 'rspec', '~> 3.0'
42
- spec.add_dependency 'httparty', '~> 0.16'
43
+ spec.add_dependency 'activesupport'
44
+ spec.add_dependency 'httparty'
43
45
  end
@@ -1,38 +1,24 @@
1
- require 'coda_docs/client/docs'
2
- require 'coda_docs/client/sections'
3
- require 'coda_docs/client/folders'
4
- require 'coda_docs/client/tables'
5
- require 'coda_docs/client/rows'
6
- require 'coda_docs/client/columns'
7
- require 'coda_docs/client/formulas'
8
- require 'coda_docs/client/controls'
9
- require 'coda_docs/client/account'
10
- require 'coda_docs/client/miscellaneous'
1
+ require 'active_support/core_ext/string'
2
+ require 'coda_docs/connection'
3
+ require 'coda_docs/entities/entity'
4
+ Dir[File.join(__dir__, 'entities', '*.rb')].each { |f| require f }
11
5
 
12
6
  module CodaDocs
13
7
  class Client
14
- include HTTParty
15
- include CodaDocs::Client::Docs
16
- include CodaDocs::Client::Sections
17
- include CodaDocs::Client::Folders
18
- include CodaDocs::Client::Tables
19
- include CodaDocs::Client::Rows
20
- include CodaDocs::Client::Columns
21
- include CodaDocs::Client::Formulas
22
- include CodaDocs::Client::Controls
23
- include CodaDocs::Client::Account
24
- include CodaDocs::Client::Miscellaneous
25
- base_uri 'https://coda.io/apis/v1beta1'
26
- format :json
27
-
28
8
  def initialize(access_token = nil)
29
- access_token ||= ENV['CODA_DOCS_API_KEY']
30
- self.class.default_options.merge!(
31
- headers: {
32
- 'Authorization' => "Bearer #{access_token}",
33
- 'Content-Type' => 'application/json'
34
- }
35
- )
9
+ @access_token = access_token || ENV['CODA_DOCS_API_KEY']
10
+ end
11
+
12
+ def method_missing(method_name, *args, &block)
13
+ klass = "CodaDocs::Entities::#{method_name.to_s.capitalize}"
14
+ .constantize
15
+ if klass
16
+ klass.new(access_token)
17
+ end
36
18
  end
19
+
20
+ private
21
+
22
+ attr_reader :access_token
37
23
  end
38
24
  end
@@ -0,0 +1,7 @@
1
+ module CodaDocs
2
+ class Connection
3
+ include HTTParty
4
+ base_uri 'https://coda.io/apis/v1'
5
+ format :json
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ module CodaDocs
2
+ module Entities
3
+ class Account < Entity
4
+ def whoami
5
+ connection.get('/whoami')
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ module CodaDocs
2
+ module Entities
3
+ class Categories < Entity
4
+ def all
5
+ response = connection.get('/categories')
6
+ parse_response(response)
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ module CodaDocs
2
+ module Entities
3
+ class Columns < Entity
4
+ def all(doc_id, table_id, options = nil)
5
+ response = connection.get("/docs/#{doc_id}/tables/#{table_id}/columns", query: options)
6
+ parse_response(response)
7
+ end
8
+
9
+ def find(doc_id, table_id, column_id)
10
+ connection.get("/docs/#{doc_id}/tables/#{table_id}/columns/#{column_id}")
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ module CodaDocs
2
+ module Entities
3
+ class Controls < Entity
4
+ def all(doc_id, options = nil)
5
+ response = connection.get("/docs/#{doc_id}/controls", query: options)
6
+ parse_response(response)
7
+ end
8
+
9
+ def find(doc_id, control_id)
10
+ connection.get("/docs/#{doc_id}/controls/#{control_id}")
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,36 @@
1
+ module CodaDocs
2
+ module Entities
3
+ class Docs < Entity
4
+ def all(options = nil)
5
+ response = connection.get('/docs', query: options)
6
+ parse_response(response)
7
+ end
8
+
9
+ def find(doc_id)
10
+ connection.get("/docs/#{doc_id}")
11
+ end
12
+
13
+ def create(options)
14
+ connection.post(
15
+ '/docs',
16
+ body: options.to_json
17
+ )
18
+ end
19
+
20
+ def delete(doc_id)
21
+ connection.delete("/docs/#{doc_id}")
22
+ end
23
+
24
+ def publish(doc_id, options)
25
+ connection.put(
26
+ "/docs/#{doc_id}/publish",
27
+ body: options.to_json
28
+ )
29
+ end
30
+
31
+ def unpublish(doc_id)
32
+ connection.delete("/docs/#{doc_id}/publish")
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,26 @@
1
+ module CodaDocs
2
+ module Entities
3
+ class Entity
4
+ def initialize(access_token)
5
+ @access_token = access_token
6
+ end
7
+
8
+ def parse_response(response)
9
+ response.parsed_response['items']
10
+ end
11
+
12
+ def connection
13
+ conn = CodaDocs::Connection
14
+ conn.default_options.merge!(
15
+ headers: {
16
+ 'Authorization' => "Bearer #{@access_token}",
17
+ 'Content-Type' => 'application/json'
18
+ }
19
+ )
20
+ conn
21
+ end
22
+ end
23
+ end
24
+ end
25
+
26
+
@@ -0,0 +1,14 @@
1
+ module CodaDocs
2
+ module Entities
3
+ class Formulas < Entity
4
+ def all(doc_id, options = nil)
5
+ response = connection.get("/docs/#{doc_id}/formulas", query: options)
6
+ parse_response(response)
7
+ end
8
+
9
+ def find(doc_id, formula_id)
10
+ connection.get("/docs/#{doc_id}/formulas/#{formula_id}")
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,8 +1,8 @@
1
1
  module CodaDocs
2
- class Client
3
- module Miscellaneous
2
+ module Entities
3
+ class Miscellaneous < Entity
4
4
  def resolve_browser_link(url, degrade_gracefully = true)
5
- self.class.get('/resolveBrowserLink', query: { url: url, degradeGracefully: degrade_gracefully })
5
+ connection.get('/resolveBrowserLink', query: { url: url, degradeGracefully: degrade_gracefully })
6
6
  end
7
7
  end
8
8
  end
@@ -0,0 +1,21 @@
1
+ module CodaDocs
2
+ module Entities
3
+ class Pages < Entity
4
+ def all(doc_id, options = nil)
5
+ response = connection.get("/docs/#{doc_id}/pages", query: options)
6
+ parse_response(response)
7
+ end
8
+
9
+ def find(doc_id, page_id, options = nil)
10
+ connection.get("/docs/#{doc_id}/pages/#{page_id}", query: options)
11
+ end
12
+
13
+ def update(doc_id, page_id, options)
14
+ connection.put(
15
+ "/docs/#{doc_id}/pages/#{page_id}",
16
+ body: options.to_json
17
+ )
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,18 @@
1
+ module CodaDocs
2
+ module Entities
3
+ class Rows < Entity
4
+ def all(doc_id, table_id, options = nil)
5
+ response = connection.get("/docs/#{doc_id}/tables/#{table_id}/rows", query: options)
6
+ parse_response(response)
7
+ end
8
+
9
+ def find(doc_id, table_id, row_id)
10
+ connection.get("/docs/#{doc_id}/tables/#{table_id}/rows/#{row_id}")
11
+ end
12
+
13
+ def delete(doc_id, table_id, row_id)
14
+ connection.delete("/docs/#{doc_id}/tables/#{table_id}/rows/#{row_id}")
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,14 @@
1
+ module CodaDocs
2
+ module Entities
3
+ class Tables < Entity
4
+ def all(doc_id, options = nil)
5
+ response = connection.get("/docs/#{doc_id}/tables", query: options)
6
+ parse_response(response)
7
+ end
8
+
9
+ def find(doc_id, table_id)
10
+ connection.get("/docs/#{doc_id}/tables/#{table_id}")
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module CodaDocs
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '1.0.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coda_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Muñoz
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-02 00:00:00.000000000 Z
11
+ date: 2020-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.16'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.16'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: dotenv
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -42,44 +42,44 @@ dependencies:
42
42
  name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0.12'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '0.12'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pry-byebug
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '3.6'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '3.6'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '10.0'
75
+ version: '13.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '10.0'
82
+ version: '13.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -94,28 +94,42 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '3.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: activesupport
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: httparty
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
- - - "~>"
115
+ - - ">="
102
116
  - !ruby/object:Gem::Version
103
- version: '0.16'
117
+ version: '0'
104
118
  type: :runtime
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
- - - "~>"
122
+ - - ">="
109
123
  - !ruby/object:Gem::Version
110
- version: '0.16'
111
- description: Gem to help integrate Ruby <> Coda Docs API (0.1.1-beta). Work is still
112
- in progress and everything is subject to change.
124
+ version: '0'
125
+ description: Coda Docs Api Gem
113
126
  email:
114
127
  - carlos@monday.vc
115
128
  executables: []
116
129
  extensions: []
117
130
  extra_rdoc_files: []
118
131
  files:
132
+ - ".codeclimate.yml"
119
133
  - ".gitignore"
120
134
  - ".rspec"
121
135
  - ".rubocop.yml"
@@ -130,16 +144,18 @@ files:
130
144
  - coda_docs.gemspec
131
145
  - lib/coda_docs.rb
132
146
  - lib/coda_docs/client.rb
133
- - lib/coda_docs/client/account.rb
134
- - lib/coda_docs/client/columns.rb
135
- - lib/coda_docs/client/controls.rb
136
- - lib/coda_docs/client/docs.rb
137
- - lib/coda_docs/client/folders.rb
138
- - lib/coda_docs/client/formulas.rb
139
- - lib/coda_docs/client/miscellaneous.rb
140
- - lib/coda_docs/client/rows.rb
141
- - lib/coda_docs/client/sections.rb
142
- - lib/coda_docs/client/tables.rb
147
+ - lib/coda_docs/connection.rb
148
+ - lib/coda_docs/entities/account.rb
149
+ - lib/coda_docs/entities/categories.rb
150
+ - lib/coda_docs/entities/columns.rb
151
+ - lib/coda_docs/entities/controls.rb
152
+ - lib/coda_docs/entities/docs.rb
153
+ - lib/coda_docs/entities/entity.rb
154
+ - lib/coda_docs/entities/formulas.rb
155
+ - lib/coda_docs/entities/miscellaneous.rb
156
+ - lib/coda_docs/entities/pages.rb
157
+ - lib/coda_docs/entities/rows.rb
158
+ - lib/coda_docs/entities/tables.rb
143
159
  - lib/coda_docs/version.rb
144
160
  homepage: https://github.com/joinmonday/coda_docs
145
161
  licenses: []
@@ -148,7 +164,7 @@ metadata:
148
164
  homepage_uri: https://github.com/joinmonday/coda_docs
149
165
  source_code_uri: https://github.com/joinmonday/coda_docs
150
166
  changelog_uri: https://github.com/joinmonday/coda_docs
151
- post_install_message:
167
+ post_install_message:
152
168
  rdoc_options: []
153
169
  require_paths:
154
170
  - lib
@@ -156,16 +172,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
156
172
  requirements:
157
173
  - - ">="
158
174
  - !ruby/object:Gem::Version
159
- version: '0'
175
+ version: '2.4'
160
176
  required_rubygems_version: !ruby/object:Gem::Requirement
161
177
  requirements:
162
178
  - - ">="
163
179
  - !ruby/object:Gem::Version
164
180
  version: '0'
165
181
  requirements: []
166
- rubyforge_project:
167
- rubygems_version: 2.7.7
168
- signing_key:
182
+ rubygems_version: 3.0.8
183
+ signing_key:
169
184
  specification_version: 4
170
185
  summary: Coda Docs Api Gem
171
186
  test_files: []
@@ -1,9 +0,0 @@
1
- module CodaDocs
2
- class Client
3
- module Account
4
- def whoami
5
- self.class.get('/whoami')
6
- end
7
- end
8
- end
9
- end
@@ -1,14 +0,0 @@
1
- module CodaDocs
2
- class Client
3
- module Columns
4
- def columns(doc_id, table_id, options = {})
5
- response = self.class.get("/docs/#{doc_id}/tables/#{table_id}/columns", query: options)
6
- response.parsed_response['items']
7
- end
8
-
9
- def column(doc_id, table_id, column_id, options = {})
10
- self.class.get("/docs/#{doc_id}/tables/#{table_id}/columns/#{column_id}", query: options)
11
- end
12
- end
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- module CodaDocs
2
- class Client
3
- module Controls
4
- def controls(doc_id, options = {})
5
- response = self.class.get("/docs/#{doc_id}/controls", query: options)
6
- response.parsed_response['items']
7
- end
8
-
9
- def formula(doc_id, control_id, options = {})
10
- self.class.get("/docs/#{doc_id}/controls/#{control_id}", query: options)
11
- end
12
- end
13
- end
14
- end
@@ -1,24 +0,0 @@
1
- module CodaDocs
2
- class Client
3
- module Docs
4
- def docs(options = {})
5
- response = self.class.get('/docs', query: options)
6
- response.parsed_response['items']
7
- end
8
-
9
- def doc(doc_id, options = {})
10
- self.class.get("/docs/#{doc_id}", query: options)
11
- end
12
-
13
- def create_doc(title = 'Untitled', source_doc = nil)
14
- self.class.post(
15
- '/docs',
16
- body: {
17
- 'title' => title,
18
- 'sourceDoc' => source_doc
19
- }.to_json
20
- )
21
- end
22
- end
23
- end
24
- end
@@ -1,14 +0,0 @@
1
- module CodaDocs
2
- class Client
3
- module Folders
4
- def folders(doc_id, options = {})
5
- response = self.class.get("/docs/#{doc_id}/folders", query: options)
6
- response.parsed_response['items']
7
- end
8
-
9
- def folder(doc_id, folder_id, options = {})
10
- self.class.get("/docs/#{doc_id}/folders/#{folder_id}", query: options)
11
- end
12
- end
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- module CodaDocs
2
- class Client
3
- module Formulas
4
- def formulas(doc_id, options = {})
5
- response = self.class.get("/docs/#{doc_id}/formulas", query: options)
6
- response.parsed_response['items']
7
- end
8
-
9
- def formula(doc_id, formula_id, options = {})
10
- self.class.get("/docs/#{doc_id}/formulas/#{formula_id}", query: options)
11
- end
12
- end
13
- end
14
- end
@@ -1,18 +0,0 @@
1
- module CodaDocs
2
- class Client
3
- module Rows
4
- def rows(doc_id, table_id, options = {})
5
- response = self.class.get("/docs/#{doc_id}/tables/#{table_id}/rows", query: options)
6
- response.parsed_response['items']
7
- end
8
-
9
- def row(doc_id, table_id, row_id, options = {})
10
- self.class.get("/docs/#{doc_id}/tables/#{table_id}/rows/#{row_id}", query: options)
11
- end
12
-
13
- def delete_row(doc_id, table_id, row_id)
14
- self.class.delete("/docs/#{doc_id}/tables/#{table_id}/rows/#{row_id}")
15
- end
16
- end
17
- end
18
- end
@@ -1,14 +0,0 @@
1
- module CodaDocs
2
- class Client
3
- module Sections
4
- def sections(doc_id, options = {})
5
- response = self.class.get("/docs/#{doc_id}/sections", query: options)
6
- response.parsed_response['items']
7
- end
8
-
9
- def section(doc_id, section_id, options = {})
10
- self.class.get("/docs/#{doc_id}/sections/#{section_id}", query: options)
11
- end
12
- end
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- module CodaDocs
2
- class Client
3
- module Tables
4
- def tables(doc_id, options = {})
5
- response = self.class.get("/docs/#{doc_id}/tables", query: options)
6
- response.parsed_response['items']
7
- end
8
-
9
- def table(doc_id, table_id, options = {})
10
- self.class.get("/docs/#{doc_id}/tables/#{table_id}", query: options)
11
- end
12
- end
13
- end
14
- end