Maddes Posted April 4, 2016 Posted April 4, 2016 Hey Folks, I want to start creating workflows with Ruby for Alfred. I learned basic Ruby on Codecademy and have a little background in developing with Java and Objective-C, so at least OOP is familiar. However, most content I find on developing with Ruby is kind of centered around the language elements and getting them right. Though I definitely need practice, it is not exactly what I am looking for. I want to gain experience in calling applications / APIs and how to get familiar with new APIs. You can probably already see how lost I am by how I am describing the topic To wrap it up: I am looking for some tutorials, good coding examples on connecting to APIs with Ruby. Best case would be an integration with a alfred workflow. On the far horizon I want to connect to the GCalendar API to search and create events, but that's just a reference where I want to be somewhen in the future. Thanks for your advice!
ctwise Posted April 4, 2016 Posted April 4, 2016 These are fairly simple - https://github.com/ctwise/alfred-workflows
rice.shawn Posted April 7, 2016 Posted April 7, 2016 These are fairly simple - https://github.com/ctwise/alfred-workflows This is definitely the simplest way to do things. Past that, in order to write script filters, you just need to read up a bit on how Alfred reads XML and make sure that your code spits out the well-formatted XML that Alfred needs. Ruby gets a bit more complicated if you want to share your workflows because you need to be sensitive to different versions of Ruby that are installed on the systems natively (you can't assume an upgrade), and you should favor natively installed gems over including other ones (installing dependencies is a bit hard to do reliably across many different systems). But, beyond that, you can do much of what you want.
Maddes Posted April 11, 2016 Author Posted April 11, 2016 Hey ctwise, hey Shawn, thanks for your feedback and your code. I'll keep the point about different ruby versions in mind. However, from a more general point, would it make sense to rather learn python to use the broad range of workflows already written for alfred? At least that is the impression I got when I looked in some workflows I downloaded? Thanks Maddes
FroZen_X Posted April 11, 2016 Posted April 11, 2016 Hey ctwise, hey Shawn, thanks for your feedback and your code. I'll keep the point about different ruby versions in mind. However, from a more general point, would it make sense to rather learn python to use the broad range of workflows already written for alfred? At least that is the impression I got when I looked in some workflows I downloaded? Thanks Maddes This has been asked a few days ago here: http://www.alfredforum.com/topic/8682-screenshot-to-folder-tagger/page-3 Deanishe gave a pretty good answer to that on the following page: http://www.alfredforum.com/topic/8682-screenshot-to-folder-tagger/page-4 which hopefully helps you
Maddes Posted April 12, 2016 Author Posted April 12, 2016 Hi FroZen_X, thanks for the link. Somehow that inspired me to step back a bit and first take a look at python
rice.shawn Posted April 12, 2016 Posted April 12, 2016 Dean's Python library is pretty damn good, and he keeps it better maintained than any other library. If you like Python or if you want to brush up on your Python or if you want to learn Python, then writing workflows with his library is a great way to go. However, if you want to play with more Ruby, then go for it. You could always update the gems and learn from the best practices that Dean implemented with his stuff. The difficulty of Ruby dependencies is actually a bit easier than Python's dependencies (in my opinion).
deanishe Posted April 12, 2016 Posted April 12, 2016 The difficulty of Ruby dependencies is actually a bit easier than Python's dependencies (in my opinion). In what way? They've always seemed very much of a sameness to me (not that I'm particularly familiar with gems).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now