Comments (8)
Will investigate soon-ish.
from ruby-prowl.
Same thing happens to me.
Running OSX Snow Leopard with Ruby 1.8.7 and Ruby 1.9.1
from ruby-prowl.
This works for me:
~ ∴ irb
>> require "rubygems"
=> false
>> require "prowl"
=> true
>> api_key = "123abc"
=> "123abc"
>> Prowl.add(:apikey => api_key, :application => "Fishes", :event => "silly", :description => "Awwawaw.", :priority => 1)
=> 200
>>
I have version 0.1.2 of the gem installed.
Can you please post the steps necessary to reproduce this bug?
from ruby-prowl.
>> require "prowl"
=> true
>> apikey = "123abc"
=> "123abc"
>> Prowl.add(:apikey => apikey, :application => "Test", :event => "Testing", :description => "Foo bar")
=> 400
>> Prowl.add(:apikey => apikey, :application => "Test", :event => "Testing", :description => "Foo bar", :priority => 1)
=> 400
Doing exactly the same as you did, (replacing the api for the corresponding, of course) as it returns 400.
Don't know if this is supposed to happen but here it goes:
>> p = Prowl.new(:apikey => apikey, :application => "Foo")
=> #<Prowl:0x101551fe8 @api_key={:apikey=>"123abc", :application=>"Foo"}>
>> p.valid?
ArgumentError: wrong number of arguments (1 for 2)
from /Library/Ruby/Gems/1.8/gems/prowl-0.1.2/lib/prowl.rb:22:in `perform'
from /Library/Ruby/Gems/1.8/gems/prowl-0.1.2/lib/prowl.rb:22:in `valid?'
from (irb):5
>> Prowl.verify(api)
ArgumentError: wrong number of arguments (1 for 2)
from /Library/Ruby/Gems/1.8/gems/prowl-0.1.2/lib/prowl.rb:22:in `perform'
from /Library/Ruby/Gems/1.8/gems/prowl-0.1.2/lib/prowl.rb:22:in `valid?'
from /Library/Ruby/Gems/1.8/gems/prowl-0.1.2/lib/prowl.rb:32:in `verify'
from (irb):6
>>
Using gem version 0.1.2
from ruby-prowl.
After some tweaking I was able to get some results. To fix the verify error I changed perform method header to:
def perform(action, params = {})
After looking at the code I noticed this:
#<Prowl:0x101551fe8 @api_key={:apikey=>"123abc", :application=>"Foo"}>
It is keeping all the other params on the @api_key var. The only way it worked was by call it this way:
>> p = Prowl.new(api)
>> p.add(:application => "Foo", :event => "Bar", :description => "O Rly?")
from ruby-prowl.
@PedroDiogo: that doesn't make sense at all. The stack trace points to line 22, which contains nothing but whitespace. And both the entries in the stack trace points to that same line. Is your IRB-ish paste from script/console of a Rails app, or in plain IRB?
from ruby-prowl.
I can verify the same steps and errors as PedroDiogo.
augustl, when I look at line 22 in the gem that is currently being pushed, I see:
line 21:def valid?
line 22: @Valid ||= (perform("verify") == 200)
line 23: end
from ruby-prowl.
The gem and the github repo was is some sort of unsynced twilight zone that I have no explanation of how occurred. It should be fixed now.
from ruby-prowl.
Related Issues (4)
- undefined method "add" HOT 1
- undefined method "add" HOT 3
- Bump the version number please HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby-prowl.