Skip to content

Commit

Permalink
Introduce require helper
Browse files Browse the repository at this point in the history
  • Loading branch information
ruedap committed Nov 7, 2014
1 parent 4aa36a1 commit 65563f2
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 34 deletions.
16 changes: 2 additions & 14 deletions workflow/main.rb
@@ -1,18 +1,6 @@
#!/usr/bin/env ruby
# encoding: utf-8

$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
require './require_helper'

require 'rubygems' unless defined? Gem # rubygems is only needed in 1.8
require 'bundle/bundler/setup'
require 'lib/font_awesome'

# Main class
class Main
def initialize(queries)
FontAwesome.new(queries).to_alfred
end
end

# entry point
Main.new(ARGV)
FontAwesome.new(ARGV).to_alfred # entry point
6 changes: 1 addition & 5 deletions workflow/press_cmd_enter.rb
@@ -1,11 +1,7 @@
#!/usr/bin/env ruby
# encoding: utf-8

$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))

require 'rubygems' unless defined? Gem # rubygems is only needed in 1.8
require 'bundle/bundler/setup'
require 'lib/font_awesome'
require './require_helper'

argv = FontAwesome.argv(ARGV)
print FontAwesome.url(argv.icon_id)
6 changes: 1 addition & 5 deletions workflow/press_ctrl_enter.rb
@@ -1,11 +1,7 @@
#!/usr/bin/env ruby
# encoding: utf-8

$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))

require 'rubygems' unless defined? Gem # rubygems is only needed in 1.8
require 'bundle/bundler/setup'
require 'lib/font_awesome'
require './require_helper'

argv = FontAwesome.argv(ARGV)
print FontAwesome.character_reference(argv.icon_unicode)
6 changes: 1 addition & 5 deletions workflow/press_enter.rb
@@ -1,11 +1,7 @@
#!/usr/bin/env ruby
# encoding: utf-8

$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))

require 'rubygems' unless defined? Gem # rubygems is only needed in 1.8
require 'bundle/bundler/setup'
require 'lib/font_awesome'
require './require_helper'

argv = FontAwesome.argv(ARGV)
print FontAwesome.css_class_name(argv.icon_id)
6 changes: 1 addition & 5 deletions workflow/press_shift_enter.rb
@@ -1,11 +1,7 @@
#!/usr/bin/env ruby
# encoding: utf-8

$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))

require 'rubygems' unless defined? Gem # rubygems is only needed in 1.8
require 'bundle/bundler/setup'
require 'lib/font_awesome'
require './require_helper'

argv = FontAwesome.argv(ARGV)
print argv.icon_unicode
5 changes: 5 additions & 0 deletions workflow/require_helper.rb
@@ -0,0 +1,5 @@
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))

require 'rubygems' unless defined? Gem # rubygems is only needed in 1.8
require 'bundle/bundler/setup'
require 'lib/font_awesome'

0 comments on commit 65563f2

Please sign in to comment.