readwise 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +57 -0
- data/CHANGELOG.md +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +35 -0
- data/LICENSE.txt +21 -0
- data/README.md +54 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/readwise/book.rb +44 -0
- data/lib/readwise/client.rb +95 -0
- data/lib/readwise/highlight.rb +43 -0
- data/lib/readwise/version.rb +3 -0
- data/lib/readwise.rb +6 -0
- data/readwise.gemspec +42 -0
- metadata +105 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 60dff970e4d8c8989265de5ff247010545019f0ca9f9f93f027726de8dda5755
|
4
|
+
data.tar.gz: 5c4ad097f466e5adf35424dc07f51d45865ea325d3fa455f17c8d0d2290fa6e7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 63f00184411add2fb4403ebf67cf1fcc89a677ec84826524a92be7fce52d46bf53d2a654db17d9f04e1a89eb15ac938e7ff6ebb861e0c2931ca1d65c1803f247
|
7
|
+
data.tar.gz: 301c9c0f4bf4a810bf62a2f1a2f116f56969535c71c7b4811192be20db1c9bdba71d74962252930f6d2e85b77bcffb1e29610f311fbffd03f07f6913fcb54514
|
data/.gitignore
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/spec/examples.txt
|
9
|
+
/test/tmp/
|
10
|
+
/test/version_tmp/
|
11
|
+
/tmp/
|
12
|
+
.DS_Store
|
13
|
+
|
14
|
+
# Used by dotenv library to load environment variables.
|
15
|
+
# .env
|
16
|
+
|
17
|
+
# Ignore Byebug command history file.
|
18
|
+
.byebug_history
|
19
|
+
|
20
|
+
## Specific to RubyMotion:
|
21
|
+
.dat*
|
22
|
+
.repl_history
|
23
|
+
build/
|
24
|
+
*.bridgesupport
|
25
|
+
build-iPhoneOS/
|
26
|
+
build-iPhoneSimulator/
|
27
|
+
|
28
|
+
## Specific to RubyMotion (use of CocoaPods):
|
29
|
+
#
|
30
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
31
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
32
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
33
|
+
#
|
34
|
+
# vendor/Pods/
|
35
|
+
|
36
|
+
## Documentation cache and generated files:
|
37
|
+
/.yardoc/
|
38
|
+
/_yardoc/
|
39
|
+
/doc/
|
40
|
+
/rdoc/
|
41
|
+
|
42
|
+
## Environment normalization:
|
43
|
+
/.bundle/
|
44
|
+
/vendor/bundle
|
45
|
+
/lib/bundler/man/
|
46
|
+
|
47
|
+
# for a library or gem, you might want to ignore these files since the code is
|
48
|
+
# intended to run in multiple environments; otherwise, check them in:
|
49
|
+
# Gemfile.lock
|
50
|
+
# .ruby-version
|
51
|
+
# .ruby-gemset
|
52
|
+
|
53
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
54
|
+
.rvmrc
|
55
|
+
|
56
|
+
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
|
57
|
+
# .rubocop-https?--*
|
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at email@andjosh.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
readwise (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
diff-lcs (1.5.0)
|
10
|
+
rake (10.5.0)
|
11
|
+
rspec (3.12.0)
|
12
|
+
rspec-core (~> 3.12.0)
|
13
|
+
rspec-expectations (~> 3.12.0)
|
14
|
+
rspec-mocks (~> 3.12.0)
|
15
|
+
rspec-core (3.12.0)
|
16
|
+
rspec-support (~> 3.12.0)
|
17
|
+
rspec-expectations (3.12.2)
|
18
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
19
|
+
rspec-support (~> 3.12.0)
|
20
|
+
rspec-mocks (3.12.2)
|
21
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
+
rspec-support (~> 3.12.0)
|
23
|
+
rspec-support (3.12.0)
|
24
|
+
|
25
|
+
PLATFORMS
|
26
|
+
ruby
|
27
|
+
|
28
|
+
DEPENDENCIES
|
29
|
+
bundler (~> 1.17)
|
30
|
+
rake (~> 10.0)
|
31
|
+
readwise!
|
32
|
+
rspec (~> 3.0)
|
33
|
+
|
34
|
+
BUNDLED WITH
|
35
|
+
1.17.2
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2023 Josh Beckman
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# Readwise
|
2
|
+
|
3
|
+
[Readwise](https://readwise.io/) is an application suite to store, revisit, and learn from your book and article highlights. This is a basic library to call the [Readwise API](https://readwise.io/api_deets) to read and write highlights.
|
4
|
+
|
5
|
+
This library is not at 100% coverage of the API, so if you need a method that is missing, open an issue or contribute changes!
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'readwise'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install readwise
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
First, obtain an API access token from https://readwise.io/access_token.
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
client = Readwise::Client.new(token: token)
|
29
|
+
|
30
|
+
books = client.export # export all highlights
|
31
|
+
books = client.export(updated_after: '2023-01-01') # export recent highlights
|
32
|
+
books = client.export(book_ids: ['123']) # export specific highlights
|
33
|
+
|
34
|
+
puts books.first.title # books are Readwise::Book structs
|
35
|
+
puts books.first.highlights.map(&:text) # highlights are Readwise::Highlight structs
|
36
|
+
```
|
37
|
+
|
38
|
+
## Development
|
39
|
+
|
40
|
+
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.
|
41
|
+
|
42
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
43
|
+
|
44
|
+
## Contributing
|
45
|
+
|
46
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/andjosh/readwise. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
47
|
+
|
48
|
+
## License
|
49
|
+
|
50
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
51
|
+
|
52
|
+
## Code of Conduct
|
53
|
+
|
54
|
+
Everyone interacting in the Readwise project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/andjosh/readwise/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "readwise"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'time'
|
2
|
+
|
3
|
+
module Readwise
|
4
|
+
Book = Struct.new(
|
5
|
+
'ReadwiseBook',
|
6
|
+
:asin,
|
7
|
+
:author,
|
8
|
+
:book_id,
|
9
|
+
:category,
|
10
|
+
:cover_image_url,
|
11
|
+
:highlights,
|
12
|
+
:readable_title,
|
13
|
+
:readwise_url,
|
14
|
+
:source,
|
15
|
+
:source_url,
|
16
|
+
:tags,
|
17
|
+
:title,
|
18
|
+
:unique_url,
|
19
|
+
keyword_init: true
|
20
|
+
) do
|
21
|
+
|
22
|
+
def article?
|
23
|
+
category == 'article'
|
24
|
+
end
|
25
|
+
|
26
|
+
def book?
|
27
|
+
category == 'book'
|
28
|
+
end
|
29
|
+
|
30
|
+
def supplemental?
|
31
|
+
category == 'supplemental'
|
32
|
+
end
|
33
|
+
|
34
|
+
def email_sourced?
|
35
|
+
!!source_url.match(/^mailto:/)
|
36
|
+
end
|
37
|
+
|
38
|
+
def highlighted_at_time
|
39
|
+
date = highlights.sort_by(&:highlighted_at).first&.highlighted_at_time
|
40
|
+
date ||= highlights.sort_by(&:updated_at).first&.updated_at_time
|
41
|
+
date || Time.now
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'net/http'
|
3
|
+
require_relative 'book.rb'
|
4
|
+
require_relative 'highlight.rb'
|
5
|
+
|
6
|
+
module Readwise
|
7
|
+
class Client
|
8
|
+
class Error < StandardError; end
|
9
|
+
|
10
|
+
def initialize(token: nil)
|
11
|
+
raise ArgumentError unless token
|
12
|
+
@token = token.to_s
|
13
|
+
end
|
14
|
+
|
15
|
+
def create_highlight(highlight:)
|
16
|
+
create_highlights([highlight])
|
17
|
+
end
|
18
|
+
|
19
|
+
def create_highlights(highlights: [])
|
20
|
+
raise NotImplementedError
|
21
|
+
end
|
22
|
+
|
23
|
+
def export(updated_after: nil, book_ids: [])
|
24
|
+
resp = export_page(updated_after: updated_after, book_ids: book_ids)
|
25
|
+
next_page_cursor = resp[:next_page_cursor]
|
26
|
+
results = resp[:results]
|
27
|
+
while next_page_cursor
|
28
|
+
resp = export_page(updated_after: updated_after, book_ids: book_ids, page_cursor: next_page_cursor)
|
29
|
+
results.concat(resp[:results])
|
30
|
+
next_page_cursor = resp[:next_page_cursor]
|
31
|
+
end
|
32
|
+
results.sort_by(&:highlighted_at_time)
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def export_page(page_cursor: nil, updated_after: nil, book_ids: [])
|
38
|
+
params = {}
|
39
|
+
params['updatedAfter'] = updated_after if updated_after
|
40
|
+
params['ids'] = book_ids if book_ids.any?
|
41
|
+
params['pageCursor'] = page_cursor if page_cursor
|
42
|
+
url = 'https://readwise.io/api/v2/export/?' + URI.encode_www_form(params)
|
43
|
+
export_uri = URI.parse(url)
|
44
|
+
export_req = Net::HTTP::Get.new(export_uri)
|
45
|
+
export_req['Authorization'] = "Token #{@token}"
|
46
|
+
export_res = Net::HTTP.start(export_uri.hostname, export_uri.port, use_ssl: true) do |http|
|
47
|
+
http.request(export_req)
|
48
|
+
end
|
49
|
+
raise Error, 'Export request failed' unless export_res.is_a?(Net::HTTPSuccess)
|
50
|
+
|
51
|
+
parsed_body = JSON.parse(export_res.body)
|
52
|
+
results = parsed_body.dig('results').map do |item|
|
53
|
+
Book.new(
|
54
|
+
asin: item['asin'],
|
55
|
+
author: item['author'],
|
56
|
+
book_id: item['user_book_id'].to_s,
|
57
|
+
category: item['category'],
|
58
|
+
cover_image_url: item['cover_image_url'],
|
59
|
+
readable_title: item['readable_title'],
|
60
|
+
readwise_url: item['readwise_url'],
|
61
|
+
source: item['source'],
|
62
|
+
source_url: item['source_url'],
|
63
|
+
tags: item['book_tags'],
|
64
|
+
title: item['title'],
|
65
|
+
unique_url: item['unique_url'],
|
66
|
+
highlights: item['highlights'].map do |highlight|
|
67
|
+
Highlight.new(
|
68
|
+
book_id: highlight['book_id'].to_s,
|
69
|
+
color: highlight['color'],
|
70
|
+
created_at: highlight['created_at'],
|
71
|
+
end_location: highlight['end_location'],
|
72
|
+
external_id: highlight['external_id'],
|
73
|
+
highlight_id: highlight['id'].to_s,
|
74
|
+
highlighted_at: highlight['highlighted_at'],
|
75
|
+
is_discard: highlight['is_discard'],
|
76
|
+
is_favorite: highlight['is_favorite'],
|
77
|
+
location: highlight['location'],
|
78
|
+
location_type: highlight['location_type'],
|
79
|
+
note: highlight['note'],
|
80
|
+
readwise_url: highlight['readwise_url'],
|
81
|
+
tags: highlight['tags'],
|
82
|
+
text: highlight['text'],
|
83
|
+
updated_at: highlight['updated_at'],
|
84
|
+
url: highlight['url'],
|
85
|
+
)
|
86
|
+
end
|
87
|
+
)
|
88
|
+
end
|
89
|
+
{
|
90
|
+
results: results,
|
91
|
+
next_page_cursor: parsed_body.dig('nextPageCursor')
|
92
|
+
}
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'time'
|
2
|
+
|
3
|
+
module Readwise
|
4
|
+
Highlight = Struct.new(
|
5
|
+
'ReadwiseHighlight',
|
6
|
+
:book_id,
|
7
|
+
:color,
|
8
|
+
:created_at,
|
9
|
+
:end_location,
|
10
|
+
:external_id,
|
11
|
+
:highlight_id,
|
12
|
+
:highlighted_at,
|
13
|
+
:is_discard,
|
14
|
+
:is_favorite,
|
15
|
+
:location,
|
16
|
+
:location_type,
|
17
|
+
:note,
|
18
|
+
:readwise_url,
|
19
|
+
:tags,
|
20
|
+
:text,
|
21
|
+
:updated_at,
|
22
|
+
:url,
|
23
|
+
keyword_init: true
|
24
|
+
) do
|
25
|
+
def created_at_time
|
26
|
+
return unless created_at
|
27
|
+
|
28
|
+
Time.parse(created_at)
|
29
|
+
end
|
30
|
+
|
31
|
+
def updated_at_time
|
32
|
+
return unless updated_at
|
33
|
+
|
34
|
+
Time.parse(updated_at)
|
35
|
+
end
|
36
|
+
|
37
|
+
def highlighted_at_time
|
38
|
+
return unless highlighted_at
|
39
|
+
|
40
|
+
Time.parse(highlighted_at)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/lib/readwise.rb
ADDED
data/readwise.gemspec
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "readwise/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "readwise"
|
8
|
+
spec.version = Readwise::VERSION
|
9
|
+
spec.authors = ["Josh Beckman"]
|
10
|
+
spec.email = ["josh@joshbeckman.org"]
|
11
|
+
|
12
|
+
spec.summary = "Readwise API client"
|
13
|
+
spec.description = "Minimal Readwise API client and highlight parsing library"
|
14
|
+
spec.homepage = "https://github.com/andjosh/readwise-ruby"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
if spec.respond_to?(:metadata)
|
20
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
21
|
+
|
22
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
23
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
24
|
+
spec.metadata["changelog_uri"] = spec.homepage + "/blob/main/CHANGELOG.md"
|
25
|
+
else
|
26
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
27
|
+
"public gem pushes."
|
28
|
+
end
|
29
|
+
|
30
|
+
# Specify which files should be added to the gem when it is released.
|
31
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
32
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
33
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
34
|
+
end
|
35
|
+
spec.bindir = "exe"
|
36
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
37
|
+
spec.require_paths = ["lib"]
|
38
|
+
|
39
|
+
spec.add_development_dependency "bundler", "~> 1.17"
|
40
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
41
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
42
|
+
end
|
metadata
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: readwise
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Josh Beckman
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-01-16 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.17'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.17'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: Minimal Readwise API client and highlight parsing library
|
56
|
+
email:
|
57
|
+
- josh@joshbeckman.org
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- CHANGELOG.md
|
64
|
+
- CODE_OF_CONDUCT.md
|
65
|
+
- Gemfile
|
66
|
+
- Gemfile.lock
|
67
|
+
- LICENSE.txt
|
68
|
+
- README.md
|
69
|
+
- Rakefile
|
70
|
+
- bin/console
|
71
|
+
- bin/setup
|
72
|
+
- lib/readwise.rb
|
73
|
+
- lib/readwise/book.rb
|
74
|
+
- lib/readwise/client.rb
|
75
|
+
- lib/readwise/highlight.rb
|
76
|
+
- lib/readwise/version.rb
|
77
|
+
- readwise.gemspec
|
78
|
+
homepage: https://github.com/andjosh/readwise-ruby
|
79
|
+
licenses:
|
80
|
+
- MIT
|
81
|
+
metadata:
|
82
|
+
allowed_push_host: https://rubygems.org
|
83
|
+
homepage_uri: https://github.com/andjosh/readwise-ruby
|
84
|
+
source_code_uri: https://github.com/andjosh/readwise-ruby
|
85
|
+
changelog_uri: https://github.com/andjosh/readwise-ruby/blob/main/CHANGELOG.md
|
86
|
+
post_install_message:
|
87
|
+
rdoc_options: []
|
88
|
+
require_paths:
|
89
|
+
- lib
|
90
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
requirements: []
|
101
|
+
rubygems_version: 3.0.3.1
|
102
|
+
signing_key:
|
103
|
+
specification_version: 4
|
104
|
+
summary: Readwise API client
|
105
|
+
test_files: []
|