mattgreen / elevate Goto Github PK
View Code? Open in Web Editor NEWStreamline your RubyMotion controllers
License: MIT License
Streamline your RubyMotion controllers
License: MIT License
You mention in the readme "... when your tasks become complex, you can elect to extract them out to a service object." Do you have an example of what you mean there?
Also, do you have any docs for the "API" class which you say "is a thin wrapper class over Elevate::HTTP"?
I'd really like to use this framework, but I'm struggling to get started without an end-to-end example, or some more docs. Thanks.
Regards,
M@
I'm getting the following error when trying to use elevate:
2013-07-08 12:46:04.108 ExampleApp[29827:1b03] user.rb:12:in `block in authenticate!:': undefined method `post' for Elevate::HTTP:Class (NoMethodError)
from operation.rb:50:in `main'
And the code:
def authenticate!(username, password)
@authenticate_task = async username: username, password: password do
task do
response = Elevate::HTTP.post("http://example.com/api/sessions.json", username: @username, password: @password)
puts "response: "
puts response.inspect
end
on_start do
puts "requesting.."
end
on_finish do |result, exception|
puts "complete.."
puts result.inspect
end
end
end
What's really strange is rubymotion seems to be renaming classes inside the HTTP namespace... for example this fails:
(main)> Elevate::HTTP::Request::METHODS
2013-07-08 12:56:02.128 ExampleApp[30165:c07] uninitialized constant Elevate::HTTP::Request (NameError)
=> #<NameError: uninitialized constant Elevate::HTTP::Request>
But this works:
(main)> Elevate::HTTP::HTTPRequest::METHODS
=> [:get, :post, :put, :delete, :patch, :head, :options]
Any ideas?
Thanks!! ๐บ
Hi,
I would like to write a periodic task with BW::EM.add_periodic_timer , and I'm wondering if I can use Elevate::HTTP safely with it. Or maybe there is a way with Elevate to create periodic task.
Could you help me ?
Regards,
Julien
Right now, only JSON APIs are supported. Generalize that to a Elevate::HTTP
module with a straight-forward API, and update HTTPClient
to use it.
Some companies will only use gems with a certain license.
The canonical and easy way to check is via the gemspec
via e.g.
spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']
There is even a License Finder to help companies ensure all gems they use
meet their licensing needs. This tool depends on license information being available in the gemspec.
Including a license in your gemspec is a good practice, in any case.
How did I find you?
I'm using a script to collect stats on gems, originally looking for download data, but decided to collect licenses too,
and make issues for missing ones as a public service :)
https://gist.github.com/bf4/5952053#file-license_issue-rb-L13 So far it's going pretty well
Maintaining the HTTP component requires more effort than it's worth. Find a way to connive AFNetworking to play nicely with Elevate.
Users should be able to set timeouts for the resulting operation. An NSTimer
would start at the operation time. When it fired, we can cancel()
the IOCoordiantor, perhaps passing in an exception to be raised on the waiting thread. This exception can be checked inside of the NSOperation
to determine if the cancellation was due to a user or a timeout.
We also want to support an on_timeout
block.
Document Elevate::HTTP and provide examples in the README.
We should support some notion of default error blocks.
Hello,
I don't understand why you automatically parse JSON response. In fact, I would like to test the returned code (response.code), then call response.body.
https://github.com/mattgreen/elevate/blob/master/lib/elevate/http/response.rb#L34
Best regards,
Julien
I've just started using Elevate and am very impressed. For simple 'gets' with no parameters, it's just what my team and I need.
But no matter what I try, I can't seem to pass a parameter into the task for 'posts'. The working examples all either use hard-coded values in setting up args or define tasks with async. I can't use the former because the argument is instance-level dynamic, and task creation is class level. I can't use the latter because async fails with NoMethodError. Worse, I can't find 'async' or any reference to it in any of the source code.
Any guidance would be appreciated!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.