Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
263 changes: 263 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1 +1,264 @@
require: rubocop-rspec

Rails/TimeZone:
Enabled: false

AccessorMethodName:
Enabled: false

ActionFilter:
Enabled: false

Alias:
Enabled: false

ArrayJoin:
Enabled: false

AsciiComments:
Enabled: false

AsciiIdentifiers:
Enabled: false

Attr:
Enabled: false

BlockNesting:
Enabled: false

CaseEquality:
Enabled: false

CharacterLiteral:
Enabled: false

ClassAndModuleChildren:
Enabled: false

ClassLength:
Enabled: false

ClassVars:
Enabled: false

CollectionMethods:
PreferredMethods:
find: detect
reduce: inject
collect: map
find_all: select

ColonMethodCall:
Enabled: false

CommentAnnotation:
Enabled: false

CyclomaticComplexity:
Enabled: false

Delegate:
Enabled: false

DeprecatedHashMethods:
Enabled: false

Documentation:
Enabled: false

DotPosition:
EnforcedStyle: trailing

DoubleNegation:
Enabled: false

EachWithObject:
Enabled: false

EmptyLiteral:
Enabled: false

Encoding:
Enabled: false

EvenOdd:
Enabled: false

FileName:
Enabled: false

FlipFlop:
Enabled: false

FormatString:
Enabled: false

GlobalVars:
Enabled: false

GuardClause:
Enabled: false

IfUnlessModifier:
Enabled: false

IfWithSemicolon:
Enabled: false

InlineComment:
Enabled: false

Lambda:
Enabled: false

LambdaCall:
Enabled: false

LineEndConcatenation:
Enabled: false

LineLength:
Max: 85

MethodLength:
Enabled: false

ModuleFunction:
Enabled: false

NegatedIf:
Enabled: false

NegatedWhile:
Enabled: false

BlockDelimiters:
Exclude:
- spec/**/*

Next:
Enabled: false

NilComparison:
Enabled: false

Not:
Enabled: false

NumericLiterals:
Enabled: false

OneLineConditional:
Enabled: false

OpMethod:
Enabled: false

ParameterLists:
Enabled: false

PercentLiteralDelimiters:
Enabled: false

PerlBackrefs:
Enabled: false

PredicateName:
NamePrefixBlacklist:
- is_

Proc:
Enabled: false

RaiseArgs:
Enabled: false

RegexpLiteral:
Enabled: false

SelfAssignment:
Enabled: false

SingleLineBlockParams:
Enabled: false

SingleLineMethods:
Enabled: false

SignalException:
Enabled: false

SpecialGlobalVars:
Enabled: false

StringLiterals:
EnforcedStyle: single_quotes

VariableInterpolation:
Enabled: false

TrailingComma:
Enabled: false

TrivialAccessors:
Enabled: false

VariableInterpolation:
Enabled: false

WhenThen:
Enabled: false

WhileUntilModifier:
Enabled: false

WordArray:
Enabled: false

# Lint

AmbiguousOperator:
Enabled: false

AmbiguousRegexpLiteral:
Enabled: false

AssignmentInCondition:
Enabled: false

ConditionPosition:
Enabled: false

DeprecatedClassMethods:
Enabled: false

ElseLayout:
Enabled: false

HandleExceptions:
Enabled: false

InvalidCharacterLiteral:
Enabled: false

LiteralInCondition:
Enabled: false

LiteralInInterpolation:
Enabled: false

Loop:
Enabled: false

ParenthesesAsGroupedExpression:
Enabled: false

RequireParentheses:
Enabled: false

UnderscorePrefixedVariableName:
Enabled: false

Void:
Enabled: false
20 changes: 9 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
ruby-pushbullet (0.1.4)
ruby-pushbullet (1.0.0)
json
rest-client (~> 1.8.0)

Expand All @@ -18,11 +18,10 @@ GEM
ast (2.0.0)
astrolabe (1.3.0)
parser (>= 2.2.0.pre.3, < 3.0)
awesome_print (1.2.0)
coderay (1.1.0)
crack (0.4.2)
safe_yaml (~> 1.0.0)
diff-lcs (1.2.5)
docile (1.1.5)
domain_name (0.5.25)
unf (>= 0.0.5, < 1.0.0)
factory_girl (4.5.0)
Expand All @@ -32,13 +31,17 @@ GEM
i18n (0.7.0)
json (1.8.2)
json (1.8.2-java)
method_source (0.8.2)
mime-types (2.99)
minitest (5.5.1)
multi_json (1.10.1)
netrc (0.11.0)
parser (2.2.0.2)
ast (>= 1.1, < 3.0)
powerpack (0.0.9)
pry (0.10.1)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rainbow (2.0.0)
rake (10.4.2)
rest-client (1.8.0)
Expand Down Expand Up @@ -66,11 +69,7 @@ GEM
rubocop-rspec (1.2.1)
ruby-progressbar (1.7.1)
safe_yaml (1.0.4)
simplecov (0.9.1)
docile (~> 1.1.0)
multi_json (~> 1.0)
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
slop (3.6.0)
thread_safe (0.3.4)
thread_safe (0.3.4-java)
tzinfo (1.2.2)
Expand All @@ -88,15 +87,14 @@ PLATFORMS
ruby

DEPENDENCIES
awesome_print
bundler
factory_girl
pry
rake
rspec (~> 3.0.0)
rubocop
rubocop-rspec
ruby-pushbullet!
simplecov
vcr
webmock

Expand Down
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,21 @@ gem install ruby-pushbullet
You can get your api token from [Account Settings](https://www.pushbullet.com/account)

```ruby
Pushbullet.api_token = 'YOUR_API_TOKEN'
Pushbullet.configure do |config|
config.api_token = 'YOUR_API_TOKEN'
end
```

## Usage

### Contact

```ruby
# Get all contacts
Pushbullet::Contact.all
# Get all Chats
Pushbullet::Chat.all

# create contact
contact = Pushbullet::Contact.create('Name', 'example@mail.com')
contact.name = 'Another name'
contact.save # update

contact = Pushbullet::Chat.create('example@mail.com')
```

### Device
Expand Down Expand Up @@ -69,19 +68,21 @@ Pushbullet::Push.create_list(id, title, items)
**Or directly from a device or a contact**

```ruby
me = Pushbullet::Contact.me
me = Pushbullet::User.me
me.push_note(title, body)

# or...

device = Pushbullet::Device.all.first
device.push_link(title, link, body)

```

### Channel
### Subscription

TODO...
```ruby
# Get all subscriptions
Pushbullet::Subscrition.all
```


## Contributing
Expand Down
Loading