Skip to content

Commit 6e40f2c

Browse files
committed
Bump to 1.0
1 parent 252af58 commit 6e40f2c

20 files changed

+128
-45
lines changed

.codeclimate.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
engines:
2+
rubocop:
3+
enabled: true
4+
duplication:
5+
enabled: true
6+
config:
7+
languages:
8+
- ruby
9+
10+
ratings:
11+
paths:
12+
- "**.rb"
13+
14+
exclude_paths:
15+
- spec/**/*

.rubocop.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Metrics/BlockNesting:
2+
Max: 2
3+
4+
Metrics/LineLength:
5+
AllowURI: true
6+
Enabled: false
7+
8+
Metrics/MethodLength:
9+
CountComments: false
10+
Max: 10
11+
12+
Metrics/ModuleLength:
13+
Max: 100
14+
15+
Metrics/ParameterLists:
16+
Max: 4
17+
CountKeywordArgs: true
18+
19+
Style/AccessModifierIndentation:
20+
EnforcedStyle: indent
21+
22+
Style/CollectionMethods:
23+
Enabled: true
24+
PreferredMethods:
25+
find_all: 'select'
26+
27+
Style/Documentation:
28+
Enabled: false
29+
30+
Style/DoubleNegation:
31+
Enabled: false
32+
33+
Style/FrozenStringLiteralComment:
34+
Enabled: false
35+
36+
Style/SpaceInsideHashLiteralBraces:
37+
EnforcedStyle: space
38+
39+
Style/TrailingCommaInLiteral:
40+
EnforcedStyleForMultiline: 'comma'
41+
42+
Style/RegexpLiteral:
43+
Enabled: false

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
language: ruby
22
cache: bundler
33

4+
notifications:
5+
email: false
6+
47
rvm:
5-
- 2.0.0
68
- 2.1
79
- 2.2
810
- ruby-head

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
2-
source "https://rubygems.org"
2+
source 'https://rubygems.org'
33

44
gem 'rake'
55
gem 'yard'

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
mastodon-api (0.0.1)
4+
mastodon-api (0.9.1)
55
addressable (~> 2.4)
66
http (~> 2.0)
77

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ Mastodon API Ruby Gem
1111

1212
A ruby interface for the [Mastodon](https://github.com/Gargron/mastodon) API.
1313

14+
## Installation
15+
1416
gem 'mastodon-api', require: 'mastodon'
1517

1618
## Documentation
1719

18-
[RubyDoc](http://www.rubydoc.info/gems/mastodon-api/Mastodon/REST/API)
20+
All the documentation is available on [RubyDoc](http://www.rubydoc.info/gems/mastodon-api/Mastodon/REST/API).
1921

2022
## Usage
2123

2224
Assuming that you already have an access token for a user on a given Mastodon instance:
2325

24-
require 'mastodon-api'
25-
2626
client = Mastodon::REST::Client.new(base_url: 'https://mastodon.social', bearer_token: 'your_access_token')
2727

2828
If you need to get an access token, you must first ensure that you have the client ID and client secret for your app on the given Mastodon instance (you should save those for future calls):

Rakefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
require 'bundler'
2+
Bundler::GemHelper.install_tasks
3+
4+
require 'rspec/core/rake_task'
5+
RSpec::Core::RakeTask.new(:spec)
6+
7+
require 'rubocop/rake_task'
8+
RuboCop::RakeTask.new
9+
10+
require 'yard'
11+
YARD::Rake::YardocTask.new
12+
13+
require 'yardstick/rake/measurement'
14+
Yardstick::Rake::Measurement.new do |measurement|
15+
measurement.output = 'measurement/report.txt'
16+
end
17+
18+
require 'yardstick/rake/verify'
19+
Yardstick::Rake::Verify.new do |verify|
20+
verify.threshold = 59.0
21+
end
22+
23+
task default: [:spec, :rubocop, :verify_measurements]

lib/mastodon/error.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Error < StandardError
2222
500 => Mastodon::Error::InternalServerError,
2323
502 => Mastodon::Error::BadGateway,
2424
503 => Mastodon::Error::ServiceUnavailable,
25-
504 => Mastodon::Error::GatewayTimeout
25+
504 => Mastodon::Error::GatewayTimeout,
2626
}.freeze
2727

2828
class << self

lib/mastodon/headers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def request_headers
1010
{
1111
user_agent: @client.user_agent,
1212
accept: '*/*',
13-
authorization: "Bearer #{@client.bearer_token}"
13+
authorization: "Bearer #{@client.bearer_token}",
1414
}
1515
end
1616
end

lib/mastodon/relationship.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
module Mastodon
22
class Relationship < Mastodon::Base
33
# @!attribute [r] id
4-
# @return [Integer] Account ID
5-
# @!attribute [r] following?
6-
# @return [Boolean]
7-
# @!attribute [r] followed_by?
8-
# @return [Boolean]
9-
# @!attribute [r] blocking?
10-
# @return [Boolean]
4+
# @return [Integer] Account ID
5+
# @!attribute [r] following?
6+
# @return [Boolean]
7+
# @!attribute [r] followed_by?
8+
# @return [Boolean]
9+
# @!attribute [r] blocking?
10+
# @return [Boolean]
1111

1212
normal_attr_reader :id
1313
predicate_attr_reader :following, :followed_by, :blocking

0 commit comments

Comments
 (0)