Jump to content

Search the Community

Showing results for tags 'ruby'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Alfred 3
  • Make the Most of Alfred
    • Discussion & Help
    • Bug Reports
    • Alfred Feature Suggestions
    • Themes
  • Alfred Workflows
    • Share your Workflows
    • Workflow Help & Questions
  • Alfred v2 Themes
  • Alfred Remote for iOS
    • Alfred Remote Discussion & Help
    • Remote Connection Troubleshooting

Categories

  • Articles
    • Forum Integration
    • Frontpage
  • Pages
  • Miscellaneous
    • Databases
    • Templates
    • Media

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Twitter


Website URL


Jabber


Location


Interests

  1. Hello everyone. 👋 I wanted to post about my Pennyworth Ruby gem which might be of interest to folks here: https://www.alchemists.io/projects/pennyworth With the gem installed, I use Ruby to power many of the workflows but this project also has a collection of many non-Ruby powered workflows too. The entire project is devoted to supporting Alfred. Please read the project documentation for more info. Let me know if there are any questions. Thanks and enjoy! 🎉
  2. What this workflow does: This Alfred workflow wraps whatever text is highlighted on your screen in pre-specified text strings. By default, this workflow will wrap the highlighted text in double carets (i.e. "^^"), but you can very easily change what text to add right before and after your highlighted text by simply editing the code to replace the `'^^'`'s on each side of `argv` with whatever text you want (making sure that whatever text you want to add is also surrounded by quotation marks). This is how the Ruby code that powers workflow looks "out of the box": print ARGV.map{ |argv|'^^' + argv + '^^' }.join If I wanted to change the workflow to wrap a piece of text—like "hello, world", for example—such that it came out "Well, hello, world!", all I would have to do is edit the code to look like this: print ARGV.map{ |argv|'Well, ' + argv + '!' }.join How to use this workflow: To use this workflow, visit my GitHub page for this workflow, download the "wrap-selected-text.alfredworkflow" file, and open the file with Alfred.
  3. This is my error : [ERROR: input.scriptfilter] JSON error: JSON text did not start with array or object and option to allow fragments not set. in JSON: input the {"items":[]} "input the" is the result of code "echo $userInput This Alfred node, runs a script called search.rb. I've screen shotted it below as well. The script calls all redbooth API's(a project management app) Projects, Tasklists and tasks. It then runs a loop through each item and looks for titles that match the user input/ARGV. I have run the script locally in my terminal and the script returns the correct objects and should be printing them/returning to Alfred. However I get the above issue and I can't seem to figure out where my disconnect is. Additional info/screen shots below. search.rb/the script alfred runs to generate the script filter options. This code(below/list_proj.rb) calls the redbooth API and takes all returned objects/projects and converts the data to json. When the script rubs as is in a alfred script node- it populates the filter options. This code works to the desired effect. Posting for comparison This is a snap shot of the work flow. Everything works with the exception of the Search function/nodes Please let me know if I can provide anything else. I have a separate plugin that provides user auth for the work flow to access the redbooth client API. Any insights to this error or what I may have missed would be well appreciated. Thanks!
  4. Hi all, I've been getting lots of requests to update this workflow to make it compatible with Ruby >=2.0 which is what's been shipping with the past couple releases of macOS. Well, I took some time this week to finally do it and also added a few new features. Results will now show their album art, and the pairing process has been improved. You can also now search by artist name and album title. I've also renamed the workflow to iTunes DJ (reminiscent of the original queuing feature in iTunes). See the README on Github for more info and download links. ------------------------------------------- ORIGINAL POST ------------------------------------------- Hey Guys! Up Next is one of my favorite features of iTunes 11, but adding songs to it can be pretty tedious. That's what this workflow tries to fix. You can search for songs right in Alfred and quickly queue them to be played in iTunes! The source is available on Github. Feel free to fork it and submit pull requests. Here's a download of the workflow that you can import directly into Alfred. This workflow works similarly to the iOS Remote app. Because of this, it needs to be paired with iTunes before you can use it. To do that just follow these instructions: iTunes must be open to complete the pairing process. Invoke Alfred and type pair followed by a 4-digit numeric pin number and hit enter. Switch to iTunes and click the devices button in the top right. Then click on Alfred in the devices list and enter your 4-digit pin. Now you're all set to start queuing songs! Just type "next" followed by the name of a song and Alfred will search as you type. Then just hit enter on the song you'd like to queue. Enjoy! Known Issues: Searching can be slow for large libraries Can only search using song titles, not artists or albums
  5. StackOverflow Search for Alfred Search for answers on StackOverflow.com from Alfred 2. Download Get StackOverflow for Alfred from GitHub or Packal. Usage .so <query> — Search StackOverflow.com for <query>. See below for syntax. ↩ or ⌘+NUM — Open result in default browser ⌘+L — Show full question title in Alfred's Large Text window Query syntax By default, words in <query> will be search for in the title of posts. To specify a tag, prefix it with ., e.g. python will search for python in the post title, .python will search for the tag python. Results Answered questions will be shown first in the list of results (and have a tick on their icon). Licensing, thanks This workflow is released under the MIT Licence. It is heavily based on Alfred-Workflow, also MIT-licensed.
  6. Dash 2 (note: paid app) has just been released and it comes with a Alfred 2 Workflow. Dash lets users instantly search through documentation for 130+ APIs (ranging from HTML to Cocoa), for more information, check out Dash's webpage. All of the Dash-supported documentation sets are available for offline use. You can get the Dash workflow by installing Dash and going to Preferences > Integration > Alfred. Supported documentation as of the 2.0 release (documentation is constantly added so this list might go out of date): iOS, OS X, Man Pages, .NET Framework, ActionScript, Akka, Android, Angular.js, Ansible, Appcelerator Titanium, Arduino, Backbone.js, Bash, Boost, Bootstrap, Bourbon, C, C++, CakePHP, Cappuccino, Chai, Chef, Clojure, Cocos2D, Cocos2D-X, Cocos3D, CodeIgniter, CoffeeScript, ColdFusion, Common Lisp, Compass, Cordova, Corona, CSS, Django, Dojo Toolkit, Drupal, D3.js, Elixir, Emacs Lisp, Ember.js, Emmet.io, Erlang, Express.js, ExpressionEngine, ExtJS, Flask, Foundation (by Zurb), Git, GLib, Grails, Go, Groovy, Haml, Haskell, HTML, Jade, Java, JavaFX, JavaScript, Joomla, jQuery, jQuery Mobile, jQuery UI, Knockout.js, Kobold2D, Laravel, LaTeX, Less, Lua, Lo-Dash, Marionette.js, Meteor, MongoDB, Mono, MooTools, MySQL, Nginx, Node.js, Ocaml, OpenCV, OpenGL, Perl, PhoneGap, PHP, Play, PostgreSQL, Processing, Prototype.js, Puppet, Python, Qt, R, Redis, Ruby, Ruby on Rails, Sass, Scala, Sencha Touch, Smarty, Sparrow, Spring Framework, SproutCore, SQLite, Stylus, SVG, Symfony, Tcl/Tk, Twig, Twisted, TYPO3, Underscore.js, Unity 3D, Vagrant, Vim, VMware vSphere, WordPress, Xamarin, Xojo, XSLT, XUL, Yii, YUI, Zend Framework, Zepto.js.
  7. 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!
  8. I have a simple keyword script that parses some arguments in Ruby and then uses `curl` to submit to a url (a Google Form). All works as advertised, including error messages after rescued Exceptions, except that I get no notification from any output in my script that occurs *after* the `curl` command. Examples: # works correctly and echoes notification puts "Completed successfully!" `curl --data #{data} #{url}` # does not echo notification `curl --data #{data} #{url}` puts "Completed successfully!" In the second case, no notification ever gets issued. If I run the script from the command line, the final "Completed successfully" line is successfully sent to STDOUT after curl returns. Any idea why this should be the case?
  9. I really love workflows and I wanted to start creating my own. I'm mostly a front-end developer and use ruby for the most part on any back-end dev work I do. I saw that Alfred supports Ruby workflows which made me very excited. I did some googling and had a hard time finding some tutorials about creating workflows with ruby, plenty with php though. I needed to learn the basics of workflows and wanted to do it in a language I knew (not familiar with php). I wrote a post detailing how a basic workflow functions with ruby. It's nothing you can't find anywhere else, but it was a good exercise to get the basics figured out and create something that helps me weekly. http://buddylreno.github.io/adventures-with-alfred-a-basic-ruby-workflow/ I look forward to all the interesting workflows people are creating!
  10. Quickly access a ruby gem's URLs with: gem <gem name> URLs include: Homepage Rubygems Page Documentation Use [Return] to visit the url in the browser and [CMD]+[Return] to copy the url to your clipboard. Download
  11. I use Chrome on my desktop, but I like to do all of my reading on my iPad or iPhone and I like using the Reading List built into Safari. I've used Pocket for this before, but a lot of stuff ends up in Safari's Reading List when I'm using the Twitter client on iOS. This workflow will take your current Chrome tab and send it to Safari's Reading List. Installation Instructions From a terminal window, run: sudo gem install rb-appscript Download the workflow from: https://www.dropbox.com/s/bnxbpiabtcjfz60/Chrome%20to%20Safari%20Reading%20List.alfredworkflow Usage Type `rl` in Alfred Script copied from: https://gist.github.com/pdxmph/1342437
  12. I have spent almost 8 hours on this and I know it's an easy fix. I want to use this fork of the Sonos Ruby gem. The problem: I don't know how to require/include the gem, neither locally as a cloned copy or as a regular "require gem_name". The script runs fine in IRB, but when I try to run it in a workflow the sound doesn't pause. I thought it might be because my system Ruby is old, but I use Mavericks so that shouldn't be a problem. You can download the Workflow here from my Dropbox. And here's a SO question with more info, too. Any help is really appreciated. I am ready to tear my hair out on this.
  13. Hi guys, I'm trying to create a simple alfred workflow (Keyword -> Run Script -> Post Notification) using ruby. If I run this scripts in the terminal, it runs just fine, but when I try to run them on Alfred, I get some errors: ruby start.rb {query} [ERROR: alfred.workflow.action.script] Code 1: -e:1:in `<main>': undefined local variable or method `start' for main:Object (NameError) I assumed that ruby wasn't in Alfred path so I tried /usr/bin/ruby start.rb {query} and got this error: [ERROR: alfred.workflow.action.script] Code 1: -e:1: unknown regexp option - b -e:1: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '(' /usr/bin/ruby start.rb asda If I use double quotes on the script name i get this errors: ruby "start.rb" {query} [ERROR: alfred.workflow.action.script] Code 1: -e:1: syntax error, unexpected tIDENTIFIER, expecting end-of-input and /usr/bin/ruby "start.rb" {query} [ERROR: alfred.workflow.action.script] Code 1: -e:1: unknown regexp option - b -e:1: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' /usr/bin/ruby "start.rb" asda ^ -e:1: syntax error, unexpected tIDENTIFIER, expecting end-of-input Can someone enlighten me why this is happening? Thanks!
  14. Hi guys, I'm trying to create one workflow using a script filter with ruby. When i put everything in alfred script box it works fine, but i'd like to keep thing organized, so I tried to create 3 separate files, that are placed in workflow folder, and then use alfred script box just to call the methods defined in this files. Something like this: require_relative "file1" require_relative "file2" require_relative "file3" ... puts some_method(param) But when I do this, I get this exception: [ERROR: alfred.workflow.input.scriptfilter] Code 1: -e:1:in `require_relative': cannot infer basepath (LoadError) from -e:1:in `<main>' So, is it possible to do something like this. If yes, how? Thanks!
  15. For any file in your Dropbox folder, this workflow shows the dropbox short link URL (e.g. http://db.tt/1LkWGVJF) and copies the link to the clipboard (Cmd+Shift+D): 1. Select a file in Finder (must be a file within your Dropbox folder, e.g. ~/Dropbox/Photos/MyPhoto1.jpg) 2. Press Command+Shift+D 3. Authorize the workflow to use the Dropbox API (only if this is the first time) 4. The shortened link pops up and is copied to the clipboard. It uses OAuth in the background to connect to Dropbox so you can authorize the Alfred 2 Workflow without storing passwords insecurely. For those who are interested, it starts a Ruby-based local web server using Sinatra which is then opened in the default browser. You can authorize the Dropbox app in your browser, and then the local server shuts itself down. Once authenticated, you don't need to do this step again. Once connected via OAuth, this workflow has the potential to do a lot of things with Dropbox, but currently only queries the dropbox service for shortened URLs. This method (using OAuth/dropbox) has the advantage that any file in your Dropbox folder can be shared, not just those in the "public" directory (a deprecated method of accessing dropbox files). The downloadable workflow itself is here (on dropbox, naturally): http://db.tt/1LkWGVJF http://db.tt/A3eZqMAr (new version, fixes direct linking to folders) And the github repository is here: https://github.com/canadaduane/alfred2-dropbox Duane
  16. Switch System Ruby Workflow for Alfred App A simple Ruby development workflow for Mavericks to switch system Ruby between 2.0.0 and 1.8.7. My use case is specifically for Alfred workflows development, since Alfred uses the system Ruby, and not the binaries from RVM or rbenv. It might come handy in similar situations where system Ruby is needed. Usage Type the switchruby keyword to see the menu option: The only actionable option is the first, which will switch between Ruby 2.0.0 and Ruby 1.8.7. The workflow will ask por Administration Privileges to continue. Installation Download the alfred-switch-ruby.alfredworkflow and import to Alfred 2. Changelog 2014-02-07 - Released
  17. Hello everybody. I am designing a workflow that will allow you to compile / interpret / execute code from most common languages, and then view output, copy to clipboard, or open in a new document. What I would like to ask is what sort of features would you like to have? This is meant to be useful and convenient for you. I will post up the workflow in progress soon. Feedback and feature requests are greatly appreciated! -Matthew
  18. Hello, I'm trying to create a workflow that does image processing to selected images in Finder. For some reason, when the script runs, it would stop executing after the first "exec" is called (e.g. when I call the "convert" command). Here's what my Alfred workflow looks like: http://goo.gl/45BiWd and here's what my Ruby script looks like: http://goo.gl/Fo7ssF I'm sorry. I have spent many hours trying to figure out why it stops after the first image is processed (resized and alpha removed). Does anyone know what the cause could be?
  19. Hello, I've just started to write Alfred workflow in Ruby with Zhaohai's workflow https://github.com/zhaocai/alfred-workflow My workflow is pretty simple, it converts the inputted units using the gem 'ruby-units' When I test the script in the terminal, it returns valid output for Alfred: >> /usr/bin/ruby main.rb 10 cm in m <items><item arg='copy=0.1' uid='' valid='yes'><title>0.1</title><subtitle>Copy to clipboard.</subtitle><icon>icon.png</icon></item></items> However, when running in Alfred, it only shows the fallback results (Google, Wiki, etc.) Here is the gist contain ruby scripts and info.plist files of my workflow: https://gist.github.com/vinh0604/8725898 I'm pretty new to Alfred workflow so maybe I missed something to make my workflow works. Please help me if you have any idea about it Thank you in advance.
  20. Hello, I am using fairly often Ruby (.rb) files to automate things, and currently they're associated with Terminal, and basically I am typing the start of their name in Alfred, and Alfred is launching them inside a Terminal window. I am wondering if Alfred can launch them in the background, without showing a Terminal window?
  21. Let’s say I have this test.rb ruby file (notice I’m not using a single quote (') but an apostrophe (’)) string = "It’s a string" puts string I can run this and get the expected output $ /usr/bin/ruby test.rb It’s a string However, in Alfred, if I have a Run Script that has the equivalent, it completely chokes and does nothing, other than the error sound. Using this as intended for it’s final version (having a hotkey that’ll pass selected text), we don’t even get the sound, just nothing.Using OS X 10.9 and Alfred 2.1.1(227).
  22. Hello again. I wonder if someone could help out with a bit of Ruby scripting. I've written a workflow that deletes a list of files selected from Alfred. The problem is with the script; I can't get it to delete the files. ext = "{query}" fileNames = text.split("/t") filesDeleted = "" fileNames.each do |fileName| command = "rm -r " + fileName system(command) filesDeleted << fileName end print filesDeleted Everything else works okay apart from the system call. Any ideas as to what I've forgotten? ...
  23. Hi, I want to write a little Workflow with Ruby. But i have a little bit trouble to do so. I use the Alfredo Library. Unfortunately until now i was not able to find some example workflows codes with the Alfredo library. Do somebody know such workflows?
  24. Hi, Here's a little workflow to query rubygems.org. Home: https://github.com/olibob/alfred-rubygems Direct download: https://github.com/olibob/alfred-rubygems/raw/master/alfred-rubygems.alfredworkflow Example: Maybe someone else than me will find it useful Regards, Olibob
  25. AlfredLite is a lightweight modular framework for creating workflows. Features Modular designOnly load the modules your workflow uses Faster load times (execution speed is an underappreciated feature of any workflow) Less bundeled dependencies Subclassable workflowsAlfred::Workflow is designed to be subclassed, the possibilities are endless! Requirements AlfredLite is tested against the following verions of Ruby: 1.8.7 (preinstalled on OS X Mountain Lion) 1.9.3 2.0.0 (preinstalled on OS X Mavericks) Contributing (aka I can't do this alone!) Bug FixesReporting bugs is encouraged and greatly appreciated, send them here. If you're contributing a bug fix, please make sure you're committing your fixes on the develop branch (bonus points for creating a dedicated bug fix branch). Feature RequestsHave an idea that will help make writing your workflows easier? Then submit it here. Available on Github Updates 2013-06-02: The first release of AlfredLite was made available today, it can be found here. Next up on the list of todos: a settings module.
×
×
  • Create New...