coda_docs 0.1.2 → 0.2.0.pre.beta

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: 1545beb50c2c4a0dfbceee14acdf9b122c3ec370
4
- data.tar.gz: ae6e206a9fe354fdd26ad1eb2bcee7a4e6ad0471
2
+ SHA256:
3
+ metadata.gz: bbbc145e6673be029873082a6d0aadb21bc9b89cd204264ba5d33c28b0f7ff7a
4
+ data.tar.gz: 1ba6290ad037435db6df6446bc57cbaf206342f3788774508b5bbb4d425ae853
5
5
  SHA512:
6
- metadata.gz: fa0b68970b5943a23d3ba98e768ab38a4a6bc3410df977c771ab14825ee34fe46df74728d8287f06af713406821bcbfe0a376498f090c83db434905f456df53c
7
- data.tar.gz: 81eeef59964671576f21859cbbaae6d771081559fe8c84d3f5bf5d5394860692dbe67b4fceeb2cfc62d0788837272c47e9d1f0226236c89a558d3327d4d970cf
6
+ metadata.gz: 7b7d7e4d3aa0898ca7c61a10892234c427ba5bfa67a9c3aaf80d4b69d0804760710eaaf1ee1997a0a1b0c795fa96438de369a074d5e0b19a095e4f7a429a9278
7
+ data.tar.gz: d1ed52129cb3c197aa838f759bd7da0d586c8473d538d43f28cabe7ec06e4b2dfab342ac2daaf3c4939efc0890c84f13747358487039d803c5564e2138e2b8cf
@@ -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,7 @@
1
1
  *.gem
2
2
  *.rbc
3
+ .ruby-version
4
+ .byebug_history
3
5
  /.config
4
6
  /coverage/
5
7
  /InstalledFiles
@@ -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
@@ -1,33 +1,33 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- coda_docs (0.1.0)
4
+ coda_docs (0.2.0.pre.beta)
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 (5.2.4)
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
16
  byebug (10.0.2)
17
17
  coderay (1.1.2)
18
- concurrent-ruby (1.1.3)
18
+ concurrent-ruby (1.1.5)
19
19
  diff-lcs (1.3)
20
20
  dotenv (2.5.0)
21
- httparty (0.16.3)
21
+ httparty (0.17.1)
22
22
  mime-types (~> 3.0)
23
23
  multi_xml (>= 0.5.2)
24
- i18n (1.1.1)
24
+ i18n (1.7.0)
25
25
  concurrent-ruby (~> 1.0)
26
26
  method_source (0.9.2)
27
- mime-types (3.2.2)
27
+ mime-types (3.3)
28
28
  mime-types-data (~> 3.2015)
29
- mime-types-data (3.2018.0812)
30
- minitest (5.11.3)
29
+ mime-types-data (3.2019.1009)
30
+ minitest (5.13.0)
31
31
  multi_xml (0.6.0)
32
32
  pry (0.12.2)
33
33
  coderay (~> 1.1.0)
@@ -57,7 +57,7 @@ PLATFORMS
57
57
  ruby
58
58
 
59
59
  DEPENDENCIES
60
- bundler (~> 1.16)
60
+ bundler
61
61
  coda_docs!
62
62
  dotenv (~> 2.5)
63
63
  pry
@@ -66,4 +66,4 @@ DEPENDENCIES
66
66
  rspec
67
67
 
68
68
  BUNDLED WITH
69
- 1.16.6
69
+ 2.0.2
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
@@ -11,6 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = 'Coda Docs Api Gem'
12
12
  spec.description = 'Coda Docs Api Gem'
13
13
  spec.homepage = 'https://github.com/joinmonday/coda_docs'
14
+ spec.required_ruby_version = '>= 2.2'
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
39
  spec.add_development_dependency 'pry'
39
40
  spec.add_development_dependency 'pry-byebug'
40
41
  spec.add_development_dependency 'rake', '~> 10.0'
41
42
  spec.add_development_dependency 'rspec', '~> 3.0'
42
43
  spec.add_dependency 'httparty'
44
+ spec.add_dependency 'activesupport'
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/v1beta1'
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,14 @@
1
+ module CodaDocs
2
+ module Entities
3
+ class Columns < Entity
4
+ def all(doc_id:, table_id:)
5
+ response = connection.get("/docs/#{doc_id}/tables/#{table_id}/columns")
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)
5
+ response = connection.get("/docs/#{doc_id}/controls")
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,26 @@
1
+ module CodaDocs
2
+ module Entities
3
+ class Docs < Entity
4
+ def all
5
+ response = connection.get('/docs')
6
+ parse_response(response)
7
+ end
8
+
9
+ def find(doc_id)
10
+ connection.get("/docs/#{doc_id}")
11
+ end
12
+
13
+ def create(title: 'Untitled', timezone: 'America/Los_Angeles', source: nil, folder_id: nil)
14
+ connection.post(
15
+ '/docs',
16
+ body: {
17
+ title: title,
18
+ sourceDoc: source,
19
+ timezone: timezone,
20
+ folderId: folder_id
21
+ }.to_json
22
+ )
23
+ end
24
+ end
25
+ end
26
+ 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 Folders < Entity
4
+ def all(doc_id)
5
+ response = connection.get("/docs/#{doc_id}/folders", query: options)
6
+ parse_response(response)
7
+ end
8
+
9
+ def find(doc_id:, folder_id:)
10
+ connection.get("/docs/#{doc_id}/folders/#{folder_id}", query: options)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ module CodaDocs
2
+ module Entities
3
+ class Formulas < Entity
4
+ def all(doc_id)
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}", query: options)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,9 @@
1
+ module CodaDocs
2
+ module Entities
3
+ class Miscellaneous < Entity
4
+ def resolve_browser_link(url:, degrade_gracefully: true)
5
+ connection.get('/resolveBrowserLink', query: { url: url, degradeGracefully: degrade_gracefully })
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,18 @@
1
+ module CodaDocs
2
+ module Entities
3
+ class Rows < Entity
4
+ def all(doc_id:, table_id:)
5
+ response = connection.get("/docs/#{doc_id}/tables/#{table_id}/rows")
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 Sections < Entity
4
+ def all(doc_id)
5
+ response = connection.get("/docs/#{doc_id}/sections")
6
+ parse_response(response)
7
+ end
8
+
9
+ def find(doc_id:, section_id:)
10
+ connection.get("/docs/#{doc_id}/sections/#{section_id}")
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ module CodaDocs
2
+ module Entities
3
+ class Tables < Entity
4
+ def all(doc_id)
5
+ response = connection.get("/docs/#{doc_id}/tables")
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.2'.freeze
2
+ VERSION = '0.2.0-beta'.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.2
4
+ version: 0.2.0.pre.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Muñoz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-23 00:00:00.000000000 Z
11
+ date: 2019-12-13 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
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: activesupport
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  description: Coda Docs Api Gem
112
126
  email:
113
127
  - carlos@monday.vc
@@ -115,8 +129,7 @@ executables: []
115
129
  extensions: []
116
130
  extra_rdoc_files: []
117
131
  files:
118
- - ".circleci/config.yml"
119
- - ".circleci/setup-rubygems.sh"
132
+ - ".codeclimate.yml"
120
133
  - ".gitignore"
121
134
  - ".rspec"
122
135
  - ".rubocop.yml"
@@ -131,16 +144,18 @@ files:
131
144
  - coda_docs.gemspec
132
145
  - lib/coda_docs.rb
133
146
  - lib/coda_docs/client.rb
134
- - lib/coda_docs/client/account.rb
135
- - lib/coda_docs/client/columns.rb
136
- - lib/coda_docs/client/controls.rb
137
- - lib/coda_docs/client/docs.rb
138
- - lib/coda_docs/client/folders.rb
139
- - lib/coda_docs/client/formulas.rb
140
- - lib/coda_docs/client/miscellaneous.rb
141
- - lib/coda_docs/client/rows.rb
142
- - lib/coda_docs/client/sections.rb
143
- - lib/coda_docs/client/tables.rb
147
+ - lib/coda_docs/connection.rb
148
+ - lib/coda_docs/entities/account.rb
149
+ - lib/coda_docs/entities/columns.rb
150
+ - lib/coda_docs/entities/controls.rb
151
+ - lib/coda_docs/entities/docs.rb
152
+ - lib/coda_docs/entities/entity.rb
153
+ - lib/coda_docs/entities/folders.rb
154
+ - lib/coda_docs/entities/formulas.rb
155
+ - lib/coda_docs/entities/miscellaneous.rb
156
+ - lib/coda_docs/entities/rows.rb
157
+ - lib/coda_docs/entities/sections.rb
158
+ - lib/coda_docs/entities/tables.rb
144
159
  - lib/coda_docs/version.rb
145
160
  homepage: https://github.com/joinmonday/coda_docs
146
161
  licenses: []
@@ -157,15 +172,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
157
172
  requirements:
158
173
  - - ">="
159
174
  - !ruby/object:Gem::Version
160
- version: '0'
175
+ version: '2.2'
161
176
  required_rubygems_version: !ruby/object:Gem::Requirement
162
177
  requirements:
163
- - - ">="
178
+ - - ">"
164
179
  - !ruby/object:Gem::Version
165
- version: '0'
180
+ version: 1.3.1
166
181
  requirements: []
167
182
  rubyforge_project:
168
- rubygems_version: 2.6.13
183
+ rubygems_version: 2.7.7
169
184
  signing_key:
170
185
  specification_version: 4
171
186
  summary: Coda Docs Api Gem
@@ -1,87 +0,0 @@
1
- # Ruby CircleCI 2.0 configuration file
2
- #
3
- # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
- #
5
- version: 2
6
- jobs:
7
- build:
8
- docker:
9
- # specify the version you desire here
10
- - image: circleci/ruby:2.4.1-node-browsers
11
-
12
- # Specify service dependencies here if necessary
13
- # CircleCI maintains a library of pre-built images
14
- # documented at https://circleci.com/docs/2.0/circleci-images/
15
- # - image: circleci/postgres:9.4
16
- working_directory: ~/repo
17
- steps:
18
- - checkout
19
-
20
- # Download and cache dependencies
21
- - restore_cache:
22
- keys:
23
- - v1-dependencies-{{ checksum "Gemfile.lock" }}
24
- # fallback to using the latest cache if no exact match is found
25
- - v1-dependencies-
26
-
27
- - run:
28
- name: install dependencies
29
- command: |
30
- bundle install --jobs=4 --retry=3 --path vendor/bundle
31
-
32
- - save_cache:
33
- paths:
34
- - ./vendor/bundle
35
- key: v1-dependencies-{{ checksum "Gemfile.lock" }}
36
-
37
- # Database setup
38
- - run: bundle exec rake db:create
39
- - run: bundle exec rake db:schema:load
40
-
41
- # run tests!
42
- - run:
43
- name: run tests
44
- command: |
45
- mkdir /tmp/test-results
46
- TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | \
47
- circleci tests split --split-by=timings)"
48
-
49
- bundle exec rspec \
50
- --format progress \
51
- --format RspecJunitFormatter \
52
- --out /tmp/test-results/rspec.xml \
53
- --format progress \
54
- $TEST_FILES
55
-
56
- # collect reports
57
- - store_test_results:
58
- path: /tmp/test-results
59
- - store_artifacts:
60
- path: /tmp/test-results
61
- destination: test-results
62
- deploy:
63
- docker:
64
- - image: circleci/ruby:2.4.1-node-browsers
65
-
66
- working_directory: ~/repo
67
-
68
- steps:
69
- - checkout
70
- - run:
71
- name: Setup Rubygems
72
- command: bash .circleci/setup-rubygems.sh
73
-
74
- - run:
75
- name: Publish to Rubygems
76
- command: |
77
- gem build coda_docs.gemspec
78
- gem push "$(echo coda_docs-*.gem)"
79
- workflows:
80
- version: 2
81
- build-deploy:
82
- jobs:
83
- # - build
84
- - deploy:
85
- filters:
86
- branches:
87
- only: master
@@ -1,3 +0,0 @@
1
- mkdir ~/.gem
2
- echo -e "---\r\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
3
- chmod 0600 /home/circleci/.gem/credentials
@@ -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 control(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,9 +0,0 @@
1
- module CodaDocs
2
- class Client
3
- module Miscellaneous
4
- def resolve_browser_link(url, degrade_gracefully = true)
5
- self.class.get('/resolveBrowserLink', query: { url: url, degradeGracefully: degrade_gracefully })
6
- end
7
- end
8
- end
9
- 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