diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.8694C3FC-8218-4B98-BB1F-F1CEC686477C b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.8694C3FC-8218-4B98-BB1F-F1CEC686477C deleted file mode 160000 index 24666fa..0000000 --- a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.8694C3FC-8218-4B98-BB1F-F1CEC686477C +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 24666fa0572ff0152f827f83817f23cf0e5055d7 diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/2A5C0A87-204E-49EA-94A7-8E62BB4EFD8A.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/2A5C0A87-204E-49EA-94A7-8E62BB4EFD8A.png new file mode 100644 index 0000000..f2c85b2 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/2A5C0A87-204E-49EA-94A7-8E62BB4EFD8A.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/CHANGELOG.md b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/CHANGELOG.md new file mode 100644 index 0000000..6584dec --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/CHANGELOG.md @@ -0,0 +1,52 @@ +## Current + +## 1.0.0 - 2015.11.01 +### Changed +- Use [Alphred](https://github.com/kejadlen/alphred) + +## 0.0.8 - 2015.05.31 +### Added +- Re-add support for `DEFAULT_LAT_LONG` and `DEFAULT_LOCATION`. + +## 0.0.7 - 2015.01.05 +### Added +- The current location is retrieved via IP geolocation rather than set in the + workflow configuration. +- Fixed opening the forecast in the browser. + +### Removed +- Support for `DEFAULT_LAT_LONG` and `DEFAULT_LOCATION` has been deprecated in favor + of getting the current location from the IP. + +## 0.0.6 - 2014.12.13 +### Added +- Add option to force Celsius/Fahrenheit using `FORECAST_UNITS`. + +## 0.0.5 - 2014.11.22 +### Changed +- Use `forecast-config` for managing API keys. +- Fixed bug when precipitation intensity/probability was all 0's. + +## 0.0.4 - 2014.11.21 +### Added +- Sparklines for precipitation intensity and probability for the next hour + (where applicable) and day. + +### Changed +- Bugfix for when `DEFAULT_LAT_LONG` is set and `DEFAULT_LOCATION` is not. + +## 0.0.3 - 2014.11.19 +### Added +- Forecast now uses units appropriate to the location. + +### Changed +- Fix `DEFAULT_LAT_LONG`. + +## 0.0.2 - 2014.11.19 +### Changed +- Remove minutely result for non-US locations since Forecast doesn't have this + data. + +## 0.0.1 - 2014.11.18 +### Added +- Initial release diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/Gemfile b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/Gemfile new file mode 100644 index 0000000..a12d1c2 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/Gemfile @@ -0,0 +1,7 @@ +source "https://rubygems.org" + +gem "alphred", "~> 1.1" + +group :development do + gem "pry" +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/Gemfile.lock b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/Gemfile.lock new file mode 100644 index 0000000..f64845e --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/Gemfile.lock @@ -0,0 +1,23 @@ +GEM + remote: https://rubygems.org/ + specs: + alphred (1.1.0) + builder (~> 3.2) + builder (3.2.2) + coderay (1.1.0) + method_source (0.8.2) + pry (0.10.3) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + slop (3.6.0) + +PLATFORMS + ruby + +DEPENDENCIES + alphred (~> 1.1) + pry + +BUNDLED WITH + 1.10.6 diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/README.md b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/README.md new file mode 100644 index 0000000..a3d2b39 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/README.md @@ -0,0 +1,44 @@ +# Forecast Workflow for Alfred + +![screenshot][screenshot] + +[screenshot]: http://i.imgur.com/mxGnovo.png + +# Requirements + +- [Alfred](http://www.alfredapp.com/) +- [Alfred Powerpack](http://www.alfredapp.com/powerpack/) +- OS X Mavericks + +# Installation + +Download and install the [workflow][download]. + +[download]: https://github.com/kejadlen/forecast.alfredworkflow/releases/download/0.0.5/Forecast.alfredworkflow + +Run `forecast-config VALUE` to set API keys and the default location: + +- `FORECAST_API_KEY`: Get an API key [here][forecast-api-key]. +- `GOOGLE_API_KEY`: Get an API key [here][google-api-key]. (Used for geocoding + queries. *This can be omitted if you only want the forecast for the current + location*.) +- `FORECAST_UNITS`: Defaults to `auto`, which sets the units based on the + location. Use `si` for Celsius and `us` for Fahrenheit. +- `DEFAULT_LAT_LONG`: Set this to override IP geolocation. Ex: `47.7396,-122.3426` for Seattle. +- `DEFAULT_LOCATION`: Used for displaying the location name when using `DEFAULT_LAT_LONG`. + +[forecast-api-key]: https://developer.forecast.io/register +[google-api-key]: https://developers.google.com/maps/documentation/geocoding/#api_key + +# TODO + +- Handle errors gracefully +- Caching? (Probably unnecessary...) +- Use `Accept-Encoding: gzip` for Forecast calls + +# Attributions + +- [Climacons](http://adamwhitcroft.com/climacons/) +- [Forecast API](https://developer.forecast.io/docs/v2) +- [Google Geocoding API](https://developers.google.com/maps/documentation/geocoding/) +- [ipinfo.io](http://ipinfo.io/) diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/Rakefile b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/Rakefile new file mode 100644 index 0000000..911ecca --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/Rakefile @@ -0,0 +1 @@ +require "alphred/tasks" diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/config.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/config.rb new file mode 100644 index 0000000..b64e965 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/config.rb @@ -0,0 +1,14 @@ +$LOAD_PATH.unshift(File.expand_path("../vendor/bundle", __FILE__)) +require "bundler/setup" + +require "alphred" + +module Forecast + Config = Alphred::Config.load( + FORECAST_API_KEY: nil, + GOOGLE_API_KEY: nil, + FORECAST_UNITS: nil, + DEFAULT_LOCATION: nil, + DEFAULT_LAT_LONG: nil, + ) +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/forecast.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/forecast.rb new file mode 100644 index 0000000..2cf8207 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/forecast.rb @@ -0,0 +1,145 @@ +$LOAD_PATH.unshift(File.expand_path("../vendor/bundle", __FILE__)) +require "bundler/setup" + +require "alphred" + +require_relative 'config' +require_relative 'forecaster' +require_relative 'location' +require_relative 'spark' + +ICONS = { + 'clear-day' => 'Sun', + 'clear-night' => 'Moon', + 'rain' => 'Cloud-Rain', + 'snow' => 'Cloud-Snow', + 'sleet' => 'Cloud-Snow-Alt', + 'wind' => 'Wind', + 'fog' => 'Cloud-Fog', + 'cloudy' => 'Cloud', + 'partly-cloudy-day' => 'Cloud-Sun', + 'partly-cloudy-night' => 'Cloud-Moon', +} + +Precipitation = Struct.new(:intensity, :probability) do + def self.from_forecast(forecast) + self.new(*forecast.values_at('precipIntensity', 'precipProbability')) + end + + def human_intensity + case intensity + when 0...0.002 + 'no' + when 0.002...0.017 + 'very light' + when 0.017...0.1 + 'light' + when 0.1...0.4 + 'moderate' + else + 'heavy' + end + end + + def to_s + "#{(probability*100).to_i}% chance of #{human_intensity} rain." + end +end + +query = ARGV.shift || '' +location = if query.empty? + if Forecast::Config['DEFAULT_LAT_LONG'].empty? + Location.from_ip + else + lat, long = Forecast::Config['DEFAULT_LAT_LONG'].split(?,).map(&:to_f) + Location.new(Forecast::Config['DEFAULT_LOCATION'], lat, long) + end + else + Location.new(query) + end +forecast = Forecaster.forecast(location) + +items = Alphred::Items.new + +items << Alphred::Item.new( + uid: :location, + arg: "#{location.lat.round(4)},#{location.long.round(4)}", + valid: true, + title: location.name, + icon: 'icons/forecast.png', +) + +currently = forecast['currently'] +precip = Precipitation.from_forecast(currently) +subtitle = [ "#{currently['temperature'].round}°" ] +subtitle << "Feels like #{currently['apparentTemperature'].round}°" +subtitle << precip.to_s if precip.probability > 0 +items << Alphred::Item.new( + uid: :currently, + title: currently['summary'], + subtitle: subtitle.join(' · '), + icon: "icons/#{ICONS[currently['icon']]}.png", +) + +minutely = forecast['minutely'] +if minutely + intensity = minutely['data'].map {|m| m['precipIntensity'] } + intensity = intensity.select.with_index {|_,i| i % 4 == 0 } + min, max = intensity.minmax + intensity = intensity.map {|i| 1000 * i } + + subtitle = ["#{min.round(3)}\" #{Spark.new(intensity)} #{max.round(3)}\""] + + probability = minutely['data'].map {|m| (100 * m['precipProbability']).round } + probability = probability.select.with_index {|_,i| i % 5 == 0 } + min, max = probability.minmax + + subtitle << "#{min}% #{Spark.new(probability, max: 100)} #{max}%" + + items << Alphred::Item.new( + uid: :minutely, + title: minutely['summary'], + subtitle: subtitle.join(' · '), + icon: "icons/#{ICONS[minutely['icon']]}.png", + ) +end + +hourly = forecast['hourly'] + +intensity = hourly['data'].map {|m| m['precipIntensity'] } +intensity = intensity.select.with_index {|_,i| i % 4 == 0 } +min, max = intensity.minmax +intensity = intensity.map {|i| 1000 * i } + +subtitle = ["#{min.round(3)}\" #{Spark.new(intensity)} #{max.round(3)}\""] + +probability = hourly['data'].map {|m| (100 * m['precipProbability']).round } +probability = probability.select.with_index {|_,i| i % 4 == 0 } +min, max = probability.minmax + +subtitle << "#{min}% #{Spark.new(probability, max: 100)} #{max}%" + +items << Alphred::Item.new( + uid: :hourly, + title: hourly['summary'], + subtitle: subtitle.join(' · '), + icon: "icons/#{ICONS[hourly['icon']]}.png", +) + +forecast['daily']['data'][1..6].each do |data| + wday = Time.at(data['time']).strftime('%A') + precip = Precipitation.from_forecast(data) + + subtitle = [ "Low: #{data['apparentTemperatureMin'].round}°", + "High: #{data['apparentTemperatureMax'].round}°" ] + subtitle << precip.to_s if precip.probability > 0 + + items << Alphred::Item.new( + uid: wday, + title: "#{wday} - #{data['summary']}", + subtitle: subtitle.join(' · '), + icon: "icons/#{ICONS[data['icon']]}.png", + ) +end + +puts items.to_xml diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/forecaster.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/forecaster.rb new file mode 100644 index 0000000..bdfc664 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/forecaster.rb @@ -0,0 +1,24 @@ +require 'json' +require 'open-uri' + +require_relative 'config' + +Forecaster = Struct.new(:api_key) do + def self.forecast(location) + forecaster.forecast(location) + end + + def self.forecaster + return @forecaster if defined?(@forecaster) + + @forecaster = self.new(Forecast::Config['FORECAST_API_KEY']) + end + + def forecast(location) + lat, long = location.lat, location.long + units = Forecast::Config['FORECAST_UNITS'] + url = "https://api.forecast.io/forecast/#{api_key}/#{lat},#{long}?units=#{units}" + response = JSON.load(open(url)) + end +end + diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/geocoder.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/geocoder.rb new file mode 100644 index 0000000..1f6e950 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/geocoder.rb @@ -0,0 +1,30 @@ +require 'json' +require 'open-uri' +require 'uri' + +require_relative 'config' + +Geocoder = Struct.new(:api_key) do + def self.geocode(location) + geocoder.geocode(location) + end + + def self.geocoder + return @geocoder if defined?(@geocoder) + + @geocoder = self.new(Forecast::Config['GOOGLE_API_KEY']) + end + + def geocode(location) + url = 'https://maps.googleapis.com/maps/api/geocode/json' + query = URI.encode_www_form(address: location, api_key: api_key) + response = JSON.load(open("#{url}?#{query}")) + result = response['results'][0] + + name = result['formatted_address'] + location = result['geometry']['location'] + lat, long = location.values_at('lat', 'lng') + + [name, lat, long] + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icon.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icon.png new file mode 100644 index 0000000..f2c85b2 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icon.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Download.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Download.png new file mode 100644 index 0000000..4187ce2 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Download.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle-Alt.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle-Alt.png new file mode 100644 index 0000000..31f4e8d Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle-Alt.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle-Moon-Alt.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle-Moon-Alt.png new file mode 100644 index 0000000..d51e635 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle-Moon-Alt.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle-Moon.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle-Moon.png new file mode 100644 index 0000000..079ae74 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle-Moon.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle-Sun-Alt.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle-Sun-Alt.png new file mode 100644 index 0000000..f40345e Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle-Sun-Alt.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle-Sun.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle-Sun.png new file mode 100644 index 0000000..bc475f4 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle-Sun.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle.png new file mode 100644 index 0000000..eadc3e3 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Drizzle.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog-Alt.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog-Alt.png new file mode 100644 index 0000000..24e2d6f Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog-Alt.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog-Moon-Alt.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog-Moon-Alt.png new file mode 100644 index 0000000..1359eee Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog-Moon-Alt.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog-Moon.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog-Moon.png new file mode 100644 index 0000000..bf148f9 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog-Moon.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog-Sun-Alt.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog-Sun-Alt.png new file mode 100644 index 0000000..5179981 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog-Sun-Alt.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog-Sun.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog-Sun.png new file mode 100644 index 0000000..cbc7e7f Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog-Sun.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog.png new file mode 100644 index 0000000..b02b45e Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Fog.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail-Alt.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail-Alt.png new file mode 100644 index 0000000..76cd34e Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail-Alt.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail-Moon-Alt.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail-Moon-Alt.png new file mode 100644 index 0000000..5671d7c Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail-Moon-Alt.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail-Moon.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail-Moon.png new file mode 100644 index 0000000..23b98d1 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail-Moon.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail-Sun-Alt.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail-Sun-Alt.png new file mode 100644 index 0000000..4704ebd Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail-Sun-Alt.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail-Sun.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail-Sun.png new file mode 100644 index 0000000..66d052b Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail-Sun.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail.png new file mode 100644 index 0000000..9d03310 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Hail.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Lightning-Moon.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Lightning-Moon.png new file mode 100644 index 0000000..f02c182 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Lightning-Moon.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Lightning-Sun.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Lightning-Sun.png new file mode 100644 index 0000000..9768843 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Lightning-Sun.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Lightning.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Lightning.png new file mode 100644 index 0000000..01a3725 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Lightning.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Moon.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Moon.png new file mode 100644 index 0000000..78fd657 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Moon.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain-Alt.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain-Alt.png new file mode 100644 index 0000000..e0ae91e Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain-Alt.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain-Moon-Alt.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain-Moon-Alt.png new file mode 100644 index 0000000..3dee696 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain-Moon-Alt.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain-Moon.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain-Moon.png new file mode 100644 index 0000000..752b309 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain-Moon.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain-Sun-Alt.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain-Sun-Alt.png new file mode 100644 index 0000000..3d394c6 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain-Sun-Alt.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain-Sun.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain-Sun.png new file mode 100644 index 0000000..874b6f2 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain-Sun.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain.png new file mode 100644 index 0000000..ac81b60 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Rain.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Refresh.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Refresh.png new file mode 100644 index 0000000..8131b78 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Refresh.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow-Alt.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow-Alt.png new file mode 100644 index 0000000..397934c Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow-Alt.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow-Moon-Alt.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow-Moon-Alt.png new file mode 100644 index 0000000..0c98467 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow-Moon-Alt.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow-Moon.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow-Moon.png new file mode 100644 index 0000000..0627039 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow-Moon.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow-Sun-Alt.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow-Sun-Alt.png new file mode 100644 index 0000000..11468ea Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow-Sun-Alt.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow-Sun.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow-Sun.png new file mode 100644 index 0000000..1aad15d Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow-Sun.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow.png new file mode 100644 index 0000000..dfc8731 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Snow.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Sun.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Sun.png new file mode 100644 index 0000000..09e754c Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Sun.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Upload.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Upload.png new file mode 100644 index 0000000..8f88ab3 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Upload.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Wind-Moon.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Wind-Moon.png new file mode 100644 index 0000000..b837e38 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Wind-Moon.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Wind-Sun.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Wind-Sun.png new file mode 100644 index 0000000..cc0b3e6 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Wind-Sun.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Wind.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Wind.png new file mode 100644 index 0000000..929b81a Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud-Wind.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud.png new file mode 100644 index 0000000..9419d36 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Cloud.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Compass-East.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Compass-East.png new file mode 100644 index 0000000..6468a60 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Compass-East.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Compass-North.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Compass-North.png new file mode 100644 index 0000000..417066e Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Compass-North.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Compass-South.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Compass-South.png new file mode 100644 index 0000000..f5a7484 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Compass-South.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Compass-West.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Compass-West.png new file mode 100644 index 0000000..22d9eac Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Compass-West.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Compass.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Compass.png new file mode 100644 index 0000000..12ffc33 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Compass.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Degrees-Celcius.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Degrees-Celcius.png new file mode 100644 index 0000000..7e8e593 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Degrees-Celcius.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Degrees-Fahrenheit.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Degrees-Fahrenheit.png new file mode 100644 index 0000000..cfba4a5 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Degrees-Fahrenheit.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-First-Quarter.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-First-Quarter.png new file mode 100644 index 0000000..eb5db64 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-First-Quarter.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Full.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Full.png new file mode 100644 index 0000000..d59ab86 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Full.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Last-Quarter.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Last-Quarter.png new file mode 100644 index 0000000..04823cc Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Last-Quarter.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-New.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-New.png new file mode 100644 index 0000000..1ac14eb Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-New.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Waning-Crescent.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Waning-Crescent.png new file mode 100644 index 0000000..46b4b4b Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Waning-Crescent.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Waning-Gibbous.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Waning-Gibbous.png new file mode 100644 index 0000000..5916506 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Waning-Gibbous.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Waxing-Crescent.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Waxing-Crescent.png new file mode 100644 index 0000000..8f02971 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Waxing-Crescent.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Waxing-Gibbous.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Waxing-Gibbous.png new file mode 100644 index 0000000..67daddb Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon-Waxing-Gibbous.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon.png new file mode 100644 index 0000000..8f55b3f Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Moon.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Shades.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Shades.png new file mode 100644 index 0000000..bf979e5 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Shades.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Snowflake.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Snowflake.png new file mode 100644 index 0000000..380f49d Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Snowflake.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Sun-Low.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Sun-Low.png new file mode 100644 index 0000000..2b3cd27 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Sun-Low.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Sun-Lower.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Sun-Lower.png new file mode 100644 index 0000000..4696a7b Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Sun-Lower.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Sun.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Sun.png new file mode 100644 index 0000000..b7fbb7d Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Sun.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Sunrise.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Sunrise.png new file mode 100644 index 0000000..bbb7e27 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Sunrise.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Sunset.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Sunset.png new file mode 100644 index 0000000..4919d59 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Sunset.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer-100.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer-100.png new file mode 100644 index 0000000..4ae9592 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer-100.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer-25.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer-25.png new file mode 100644 index 0000000..43f1655 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer-25.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer-50.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer-50.png new file mode 100644 index 0000000..0ab9fad Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer-50.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer-75.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer-75.png new file mode 100644 index 0000000..3d81d8a Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer-75.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer-Zero.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer-Zero.png new file mode 100644 index 0000000..a0d446b Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer-Zero.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer.png new file mode 100644 index 0000000..580a9f3 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Thermometer.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Tornado.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Tornado.png new file mode 100644 index 0000000..b0d9a6a Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Tornado.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Umbrella.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Umbrella.png new file mode 100644 index 0000000..73d8666 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Umbrella.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Wind.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Wind.png new file mode 100644 index 0000000..e7bef73 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/Wind.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/forecast.png b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/forecast.png new file mode 100644 index 0000000..f2c85b2 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/icons/forecast.png differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/info.plist b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/info.plist new file mode 100644 index 0000000..4ac4838 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/info.plist @@ -0,0 +1,179 @@ + + + + + bundleid + com.kejadlen.forecast + category + Internet + connections + + 04EA4664-95DC-4438-8978-79A17ED2FF40 + + + destinationuid + EEDF82A8-40A8-4C05-9CFA-6669A97C0E46 + modifiers + 0 + modifiersubtext + + + + 2A5C0A87-204E-49EA-94A7-8E62BB4EFD8A + + + destinationuid + F496E087-4042-44E7-B07E-71986ED6CDBA + modifiers + 0 + modifiersubtext + + + + + createdby + Alpha Chen + description + + disabled + + name + Forecast + objects + + + config + + concurrently + + escaping + 0 + script + open "http://forecast.io/#/f/{query}" + type + 0 + + type + alfred.workflow.output.script + uid + F496E087-4042-44E7-B07E-71986ED6CDBA + version + 0 + + + config + + argumenttype + 1 + escaping + 127 + keyword + forecast + queuedelaycustom + 1 + queuedelayimmediatelyinitially + + queuedelaymode + 0 + queuemode + 1 + runningsubtext + Retriving location/weather... + script + ruby forecast.rb {query} + title + Forecast + type + 0 + withspace + + + type + alfred.workflow.input.scriptfilter + uid + 2A5C0A87-204E-49EA-94A7-8E62BB4EFD8A + version + 0 + + + config + + argumenttype + 1 + escaping + 102 + keyword + config-forecast + queuedelaycustom + 3 + queuedelayimmediatelyinitially + + queuedelaymode + 0 + queuemode + 1 + script + ruby -r./config -e'puts Forecast::Config.filter_xml("{query}")' + title + Configure Forecast + type + 0 + withspace + + + type + alfred.workflow.input.scriptfilter + uid + 04EA4664-95DC-4438-8978-79A17ED2FF40 + version + 0 + + + config + + concurrently + + escaping + 102 + script + ruby -r./config -e'Forecast::Config.update!("{query}")' + type + 0 + + type + alfred.workflow.output.script + uid + EEDF82A8-40A8-4C05-9CFA-6669A97C0E46 + version + 0 + + + readme + + uidata + + 04EA4664-95DC-4438-8978-79A17ED2FF40 + + ypos + 120 + + 2A5C0A87-204E-49EA-94A7-8E62BB4EFD8A + + ypos + 10 + + EEDF82A8-40A8-4C05-9CFA-6669A97C0E46 + + ypos + 120 + + F496E087-4042-44E7-B07E-71986ED6CDBA + + ypos + 10 + + + webaddress + http://github.com/kejadlen/forecast.alfredworkflow + + diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/location.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/location.rb new file mode 100644 index 0000000..2ded3c7 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/location.rb @@ -0,0 +1,28 @@ +require 'json' +require 'open-uri' + +require_relative 'geocoder' + +class Location + def self.from_ip(ip=nil) + url = ['http://ipinfo.io', ip, 'json'].compact.join(?/) + response = JSON.load(open(url)) + + lat, long = response['loc'].split(?,).map(&:to_f) + name = "#{response['city']}, #{response['region']}" + self.new(name, lat, long) + end + + attr_accessor :name, :lat, :long, :geocoder + + def initialize(name, lat=nil, long=nil, geocoder=Geocoder) + @name, @lat, @long, @geocoder = name, lat, long, geocoder + + geocode! unless lat && long + end + + def geocode! + self.name, self.lat, self.long = geocoder.geocode(name) + end +end + diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/spark.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/spark.rb new file mode 100644 index 0000000..b6bed93 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/spark.rb @@ -0,0 +1,17 @@ +class Spark + # TICKS = %w[▁ ▂ ▃ ▄ ▅ ▆ ▇ █] # Alfred doesn't render the last bar correctly + # for some reason... + TICKS = %w[▁ ▂ ▃ ▄ ▅ ▆ ▇] + + attr_reader :data, :min, :max + + def initialize(data, **kwargs) + @data = data.map(&:round) + @min = kwargs.fetch(:min) { 0 } + @max = [(kwargs.fetch(:max) { data.max }).to_f, 1.0].max + end + + def to_s + data.map {|i| TICKS[(TICKS.size - 1) * (i - min) / max] }.join + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/test_spark.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/test_spark.rb new file mode 100644 index 0000000..9f99290 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/test_spark.rb @@ -0,0 +1,10 @@ +require 'minitest/autorun' + +require_relative 'spark' + +class TestSpark < Minitest::Test + def test_div_by_zero + spark = Spark.new([0, 0, 0]) + assert_equal '▁▁▁', spark.to_s + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/bundler/setup.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/bundler/setup.rb new file mode 100644 index 0000000..46bd82b --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/bundler/setup.rb @@ -0,0 +1,7 @@ +require 'rbconfig' +# ruby 1.8.7 doesn't define RUBY_ENGINE +ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby' +ruby_version = RbConfig::CONFIG["ruby_version"] +path = File.expand_path('..', __FILE__) +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/builder-3.2.2/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/alphred-1.1.0/lib" diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/cache/alphred-1.1.0.gem b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/cache/alphred-1.1.0.gem new file mode 100644 index 0000000..535eb32 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/cache/alphred-1.1.0.gem differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/cache/builder-3.2.2.gem b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/cache/builder-3.2.2.gem new file mode 100644 index 0000000..b59ef92 Binary files /dev/null and b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/cache/builder-3.2.2.gem differ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/.gitignore b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/.gitignore new file mode 100644 index 0000000..0cb6eeb --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/.gitignore @@ -0,0 +1,9 @@ +/.bundle/ +/.yardoc +/Gemfile.lock +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/.travis.yml b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/.travis.yml new file mode 100644 index 0000000..ac0983c --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/.travis.yml @@ -0,0 +1,4 @@ +language: ruby +rvm: + - 2.0.0 +before_install: gem install bundler -v 1.10.6 diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/CHANGELOG.md b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/CHANGELOG.md new file mode 100644 index 0000000..ed95c7a --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/CHANGELOG.md @@ -0,0 +1,12 @@ +## Unreleased + +## [1.1.0] - 2015-11-01 + +### Added +- `Config` class for handling persistent configuration across workflow updates. +- CHANGELOG + +## [1.0.0] - 2015-10-31 + +### Added +- Library for making Alfred workflows. diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/CODE_OF_CONDUCT.md b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..ce9bee7 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/CODE_OF_CONDUCT.md @@ -0,0 +1,13 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion. + +Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/) diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/Gemfile b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/Gemfile new file mode 100644 index 0000000..32fd98d --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/Gemfile @@ -0,0 +1,10 @@ +source 'https://rubygems.org' + +# Specify your gem's dependencies in alphred.gemspec +gemspec + +group :development do + gem "guard" + gem "guard-minitest" + gem "pry" +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/Guardfile b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/Guardfile new file mode 100644 index 0000000..13966bd --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/Guardfile @@ -0,0 +1,5 @@ +guard :minitest do + watch(%r{^test/(.*)\/?test_(.*)\.rb$}) + watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" } + watch(%r{^test/test_helper\.rb$}) { 'test' } +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/LICENSE.txt b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/LICENSE.txt new file mode 100644 index 0000000..a73fd4f --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Alpha Chen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/README.md b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/README.md new file mode 100644 index 0000000..b331d75 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/README.md @@ -0,0 +1,151 @@ +# Alphred + +Alphred is a library for making Alfred workflows in Ruby. It's designed +specifically for how I work, so assumes that you manage dependencies with +[Bundler][bundler] and Rubies with [chruby][chruby]. + +[bundler]: http://bundler.io/ +[chruby]: https://github.com/postmodern/chruby + +## Usage + +The [example script filter][scriptfilter] would look like this using Alphred: + +[scriptfilter]: https://www.alfredapp.com/help/workflows/inputs/script-filter/ + +``` ruby +items = Alphred::Items.new( + Alphred::Item.new(uid: "desktop", + arg: "~/Desktop", + valid: true, + autocomplete: "Desktop", + type: :file, + title: "Desktop", + subtitle: "~/Desktop", + icon: { value: "~/Desktop", type: :fileicon }), + Alphred::Item.new(uid: "flickr", + valid: false, + autocomplete: "flickr", + title: "Flickr", + icon: "flickr.png"), + Alphred::Item.new(uid: "image", + autocomplete: "My holiday photo", + type: :file, + title: "My holiday photo", + subtitle: "~/Pictures/My holiday photo.jpg", + icon: { value: "public.jpeg", type: :filetype }), + Alphred::Item.new(uid: "home", + arg: "~/", + valid: true, + autocomplete: "Home", + type: :file, + title: "Home Folder", + subtitle: "Home folder ~/", + icon: { value: "~/", type: :fileicon }, + mods: { shift: "Subtext when shift is pressed", + fn: "Subtext when fn is pressed", + ctrl: "Subtext when ctrl is pressed", + alt: "Subtext when alt is pressed", + cmd: "Subtext when cmd is pressed" }, + text: { copy: "Text when copying", + largetype: "Text for LargeType" })) +items.to_xml +``` + +This produces the following XML: + +``` xml + + + + Desktop + ~/Desktop + ~/Desktop + + + Flickr + flickr.png + + + My holiday photo + ~/Pictures/My holiday photo.jpg + public.jpeg + + + Home Folder + Home folder ~/ + ~/ + Subtext when shift is pressed + Subtext when fn is pressed + Subtext when ctrl is pressed + Subtext when alt is pressed + Subtext when cmd is pressed + Text when copying + Text for LargeType + + +``` + +### Workflow Configuration + +`Alphred::Config` provides some helpers for managing configuration that should +persist when updating the workflow. This configuration is stored in an JSON +file in the workflow data directory. + +``` ruby +# config.rb + +module Workflow + defaults = { foo: "bar" } + Config = Alphred::Config.new(**defaults) +``` + +The corresponding Script Filter input and Run Action output then look like this: + +``` shell +# script filter + +ruby -r./config -e'puts Workflow::Config.filter_xml("{query}")' +``` + +``` shell +# run action + +ruby -r./config -e'Forecast::Config.update!("{query}")' +``` + +### Releasing + +Including `alphred/tasks` in your `Rakefile` will allow access to Alphred's +Rake tasks for releasing a workflow. `release` will tag the current commit with +the provided version and create a .alfredworkflow package with vendored gem +dependencies. + +## TODO + +- Add development mode for easier debugging. (Nicer errors, etc.) + +## Development + +After checking out the repo, run `bundle install` to install dependencies. +Then, run `rake test` to run the tests. You can also run `rake console` for an +interactive prompt that will allow you to experiment. + +To install this gem onto your local machine, run `bundle exec rake install`. To +release a new version, update the version number in `version.rb`, and then run +`bundle exec rake release`, which will create a git tag for the version, push +git commits and tags, and push the `.gem` file to +[rubygems.org](https://rubygems.org). + +## Contributing + +Bug reports and pull requests are welcome on GitHub at +https://github.com/kejadlen/alphred. This project is intended to be a safe, +welcoming space for collaboration, and contributors are expected to adhere to +the [Contributor Covenant](contributor-covenant.org) code of conduct. + +## License + +The gem is available as open source under the terms of the [MIT +License](http://opensource.org/licenses/MIT). + diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/Rakefile b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/Rakefile new file mode 100644 index 0000000..96a218b --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/Rakefile @@ -0,0 +1,17 @@ +require "bundler/gem_tasks" +require "rake/testtask" + +Rake::TestTask.new(:test) do |t| + t.libs << "lib" + t.test_files = FileList['test/**/test_*.rb'] +end + +task :console do + require "bundler/setup" + require "alphred" + + require "pry" + Pry.start +end + +task :default => :test diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/alphred.gemspec b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/alphred.gemspec new file mode 100644 index 0000000..c8ffb0d --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/alphred.gemspec @@ -0,0 +1,26 @@ +# coding: utf-8 +lib = File.expand_path("../lib", __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require "alphred/version" + +Gem::Specification.new do |spec| + spec.name = "alphred" + spec.version = Alphred::VERSION + spec.authors = ["Alpha Chen"] + spec.email = ["alpha.chen@gmail.com"] + + spec.summary = %q{Helper utilities for making Alfred workflows.} + spec.homepage = "https://github.com/kejadlen/alph" + spec.license = "MIT" + + spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + spec.bindir = "bin" + spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } + spec.require_paths = ["lib"] + + spec.add_dependency "builder", "~> 3.2" + + spec.add_development_dependency "bundler", "~> 1.10" + spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "minitest" +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred.rb new file mode 100644 index 0000000..729c584 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred.rb @@ -0,0 +1,10 @@ +require "builder" + +require_relative "alphred/version" + +require_relative "alphred/config" +require_relative "alphred/icon" +require_relative "alphred/item" +require_relative "alphred/items" +require_relative "alphred/mods" +require_relative "alphred/text" diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/config.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/config.rb new file mode 100644 index 0000000..b81dd70 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/config.rb @@ -0,0 +1,52 @@ +require "json" + +module Alphred + class Config + PATH = File.join(ENV["alfred_workflow_data"], 'config.json') + + def self.load(**defaults) + config = self.new(**defaults) + config.load! + config + end + + attr_reader :data + + def initialize(**defaults) + @data = Hash[defaults.map {|k,v| [k.to_s, v.to_s] }] + end + + def load! + self.data.merge!(JSON.load(File.open(PATH))) + end + + def update!(json) + data = self.data.merge(JSON.load(json)) + File.write(PATH, JSON.dump(data), mode: ?w) + end + + def [](key) + self.data[key.to_s] + end + + def filter_xml(filter=nil) + filter ||= "" + + items = self.data.map do |key, value| + title = if filter.empty? + "Unset #{key}" + else + "Set #{key} to #{filter}" + end + Item.new( + uid: key, + arg: JSON.dump(key => filter), + title: title, + subtitle: self[key] + ) + end + + Items.new(*items).to_xml + end + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/icon.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/icon.rb new file mode 100644 index 0000000..7a7bcdf --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/icon.rb @@ -0,0 +1,39 @@ +require "builder" + +module Alphred + class Icon + VALID_TYPES = %i[ fileicon filetype ] + + attr_accessor *%i[ value type ] + + def initialize(**kwargs) + raise ArgumentError.new("missing keyword: value") unless kwargs.has_key?(:value) + + @value = kwargs[:value] + self.type = kwargs[:type] if kwargs.has_key?(:type) + end + + def type=(type) + raise ArgumentError.new("`type` must be one of #{VALID_TYPES}") unless type.nil? || VALID_TYPES.include?(type) + + @type = type + end + + def to_xml(xml=nil) + xml ||= Builder::XmlMarkup.new(indent: 2) + attrs = {} + attrs[:type] = self.type unless self.type.nil? + xml.icon self.value, attrs + end + end +end + +module Kernel + def Icon(value) + case value + when Alphred::Icon then value + when String then Alphred::Icon.new(value: value) + when Hash then Alphred::Icon.new(**value) + end + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/item.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/item.rb new file mode 100644 index 0000000..d986ddb --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/item.rb @@ -0,0 +1,59 @@ +require "builder" + +require_relative "mods" +require_relative "text" + +module Alphred + class Item + VALID_TYPES = %i[ default file file_skipcheck ] + + attr_accessor *%i[ uid arg valid autocomplete title subtitle mods icon text ] + + def initialize(**kwargs) + raise ArgumentError.new("missing keyword: title") unless kwargs.has_key?(:title) + + @title = kwargs[:title] + + %i[ uid arg valid autocomplete subtitle ].each do |attr| + self.instance_variable_set("@#{attr}", kwargs[attr]) if kwargs.has_key?(attr) + end + + @icon = Icon(kwargs[:icon]) if kwargs.has_key?(:icon) + @text = Text.new(kwargs[:text]) if kwargs.has_key?(:text) + @mods = Mods.new(kwargs[:mods]) if kwargs.has_key?(:mods) + + self.type = kwargs[:type] if kwargs.has_key?(:type) + end + + def type=(type) + raise ArgumentError.new("`type` must be one of #{VALID_TYPES}") unless type.nil? || VALID_TYPES.include?(type) + + @type = type + end + + def type + @type && @type.to_s.gsub(?_, ?:) + end + + def to_xml(xml=nil) + xml ||= Builder::XmlMarkup.new(indent: 2) + xml.item self.attrs do + xml.title self.title + xml.subtitle self.subtitle unless self.subtitle.nil? + self.icon.to_xml(xml) unless self.icon.nil? + self.mods.to_xml(xml) unless self.mods.nil? + self.text.to_xml(xml) unless self.text.nil? + end + end + + def attrs + attrs = {} + %i[ uid arg autocomplete type ].each do |attr| + value = self.send(attr) + attrs[attr] = value unless value.nil? + end + attrs[:valid] = (self.valid) ? "yes" : "no" unless self.valid.nil? + attrs + end + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/items.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/items.rb new file mode 100644 index 0000000..71dd6e5 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/items.rb @@ -0,0 +1,23 @@ +require "builder" +require "delegate" + +module Alphred + class Items < DelegateClass(Array) + attr_reader :items + + def initialize(*items) + @items = items + super(@items) + end + + def to_xml + xml = Builder::XmlMarkup.new(indent: 2) + xml.instruct! :xml + xml.items do + self.items.each do |item| + item.to_xml(xml) + end + end + end + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/mods.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/mods.rb new file mode 100644 index 0000000..01da3f0 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/mods.rb @@ -0,0 +1,22 @@ +require "builder" + +module Alphred + class Mods + MODS = %i[ shift fn ctrl alt cmd ] + + attr_accessor *MODS + + def initialize(**kwargs) + MODS.each do |mod| + self.instance_variable_set("@#{mod}", kwargs[mod]) if kwargs.has_key?(mod) + end + end + + def to_xml(xml) + MODS.each do |mod| + value = self.send(mod) + xml.subtitle value, mod: mod unless value.nil? + end + end + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/tasks.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/tasks.rb new file mode 100644 index 0000000..1e4bde8 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/tasks.rb @@ -0,0 +1,40 @@ +require "rake" + +namespace :alphred do + desc "Prepare a release, named after the directory" + task :release, [:version] => [:tag, :package] + + desc "Tag the current commit in git with VERSION" + task :tag, [:version] do |t, args| + version = args[:version] + + git_status = `git status --porcelain` + fail <<-FAIL unless git_status.empty? +Can't tag #{version}: dirty working directory. + FAIL + + sh "git tag #{version}" + end + + desc "Create an alfredworkflow package with vendored dependencies" + task :package do + restore_bundler_config do + cmd = "bundle install --standalone --path vendor/bundle --without development test" + sh "chruby-exec 2.0.0 -- #{cmd}" + end + sh "zip -r #{application_dir.pathmap("%n.alfredworkflow")} *" + rm_rf "vendor" + end + + def application_dir + Rake.application.original_dir + end + + def restore_bundler_config + path = File.join(application_dir, ".bundle", "config") + config = File.read(path) + yield + ensure + File.write(path, config, mode: ?w) + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/text.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/text.rb new file mode 100644 index 0000000..0f24576 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/text.rb @@ -0,0 +1,17 @@ +require "builder" + +module Alphred + class Text + attr_accessor *%i[ copy largetype ] + + def initialize(copy: nil, largetype: nil) + @copy = copy + @largetype = largetype + end + + def to_xml(xml) + xml.text copy, type: :copy unless self.copy.nil? + xml.text largetype, type: :largetype unless self.largetype.nil? + end + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/version.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/version.rb new file mode 100644 index 0000000..a9c6d1c --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/alphred-1.1.0/lib/alphred/version.rb @@ -0,0 +1,3 @@ +module Alphred + VERSION = "1.1.0" +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/CHANGES b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/CHANGES new file mode 100644 index 0000000..0f608fe --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/CHANGES @@ -0,0 +1,107 @@ += Change Log + +== Version 3.2.0 + +* Ruby 2.0 compatibility changes. + +* Allow single quoted attributes. + +== Version 3.1.0 + +* Included the to_xs arity patch needed for weird Rails compatibility + issue. + +* Escaping newlines in attributes now. + +* Allow method caching + +== Version 3.0.0 + +* Ruby 1.9 compatiblity issues. + +== Version 2.2.0 + +* Applied patch from Thijs van der Vossen to allow UTF-8 encoded + output when the encoding is UTF-8 and $KCODE is UTF8. + +== Version 2.1.2 + +* Fixed bug where private methods in kernel could leak through using + tag!(). Thanks to Hagen Overdick for finding and diagnosing this + bug. + +== Version 2.1.1 + +* Fixed typo in XmlMarkup class docs (ident => indent). (from Martin + Fowler). +* Removed extra directory indirection from legacy CVS to SVN move. +* Removed some extraneous tabs from source. +* Fixed test on private methods in blankslate to differentiate between + targetted and untargetted private methods. +* Removed legacy capture of @self in XmlBase (@self was used back when + we used instance eval). +* Added additional tests for global functions (both direct and included). + +== Version 2.1.0 + +* Fixed bug in BlankSlate where including a module into Object could + cause methods to leak into BlankSlate. +* Made BlankSlate available as its own gem. Currently the builder gem + still directly includes the BlankSlate code. +* Added reveal capability to BlankSlate. + +== Version 2.0.0 + +* Added doc directory +* Added unit tests for XmlEvents. +* Added XChar module and used it in the _escape method. +* Attributes are now quoted by default when strings. Use Symbol + attribute values for unquoted behavior. + +== Version 1.2.4 + +* Added a cdata! command to an XML Builder (from Josh Knowles). + +== Version 1.2.3 + +The attributes in the instruction will be ordered: +version, encoding, standalone. + +== Version 1.2.2 + +Another fix for BlankSlate. The Kernal/Object traps added in 1.2.1 +failed when a method was defined late more than once. Since the +method was already marked as removed, another attempt to undefine it +raised an error. The fix was to check the list of instance methods +before attempting the undef operation. Thanks to Florian Gross and +David Heinemeier Hansson for the patch. + +== Version 1.2.1 + +BlankSlate now traps method definitions in Kernel and Object to avoid +late method definitions inadvertently becoming part of the definition +of BlankSlate as well. + +== Version 1.2.0 + +Improved support for entity declarations by allowing nested +declarations and removal of the attribute processing. + +Added namespace support. + +== Version 1.1.0 + +Added support for comments, entity declarations and processing instructions. + +== Version 1.0.0 + +Removed use of instace_eval making the use of XmlMarkup much +less prone to error. + +== Version 0.1.1 + +Bug fix. + +== Version 0.1.0 + +Initial version release. diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/MIT-LICENSE b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/MIT-LICENSE new file mode 100644 index 0000000..7d9be51 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/MIT-LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2003-2012 Jim Weirich (jim.weirich@gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/README.md b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/README.md new file mode 100644 index 0000000..81928cc --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/README.md @@ -0,0 +1,258 @@ +# Project: Builder + +## Goal + +Provide a simple way to create XML markup and data structures. + +## Classes + +Builder::XmlMarkup:: Generate XML markup notation +Builder::XmlEvents:: Generate XML events (i.e. SAX-like) + +**Notes:** + +* An Builder::XmlTree class to generate XML tree + (i.e. DOM-like) structures is also planned, but not yet implemented. + Also, the events builder is currently lagging the markup builder in + features. + +## Usage + +```ruby + require 'rubygems' + require_gem 'builder', '~> 2.0' + + builder = Builder::XmlMarkup.new +` xml = builder.person { |b| b.name("Jim"); b.phone("555-1234") } + xml #=> Jim555-1234 +``` + +or + +```ruby + require 'rubygems' + require_gem 'builder' + + builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2) + builder.person { |b| b.name("Jim"); b.phone("555-1234") } + # + # Prints: + # + # Jim + # 555-1234 + # +``` + +## Compatibility + +### Version 2.0.0 Compatibility Changes + +Version 2.0.0 introduces automatically escaped attribute values for +the first time. Versions prior to 2.0.0 did not insert escape +characters into attribute values in the XML markup. This allowed +attribute values to explicitly reference entities, which was +occasionally used by a small number of developers. Since strings +could always be explicitly escaped by hand, this was not a major +restriction in functionality. + +However, it did surprise most users of builder. Since the body text is +normally escaped, everybody expected the attribute values to be +escaped as well. Escaped attribute values were the number one support +request on the 1.x Builder series. + +Starting with Builder version 2.0.0, all attribute values expressed as +strings will be processed and the appropriate characters will be +escaped (e.g. "&" will be translated to "&"). Attribute values +that are expressed as Symbol values will not be processed for escaped +characters and will be unchanged in output. (Yes, this probably counts +as Symbol abuse, but the convention is convenient and flexible). + +Example: + +```ruby + xml = Builder::XmlMarkup.new + xml.sample(:escaped=>"This&That", :unescaped=>:"Here&There") + xml.target! => + +``` + +### Version 1.0.0 Compatibility Changes + +Version 1.0.0 introduces some changes that are not backwards +compatible with earlier releases of builder. The main areas of +incompatibility are: + +* Keyword based arguments to +new+ (rather than positional based). It + was found that a developer would often like to specify indentation + without providing an explicit target, or specify a target without + indentation. Keyword based arguments handle this situation nicely. + +* Builder must now be an explicit target for markup tags. Instead of + writing + +```ruby + xml_markup = Builder::XmlMarkup.new + xml_markup.div { strong("text") } +``` + + you need to write + +```ruby + xml_markup = Builder::XmlMarkup.new + xml_markup.div { xml_markup.strong("text") } +``` + +* The builder object is passed as a parameter to all nested markup + blocks. This allows you to create a short alias for the builder + object that can be used within the block. For example, the previous + example can be written as: + +```ruby + xml_markup = Builder::XmlMarkup.new + xml_markup.div { |xml| xml.strong("text") } +``` + +* If you have both a pre-1.0 and a post-1.0 gem of builder installed, + you can choose which version to use through the RubyGems + +require_gem+ facility. + +```ruby + require_gem 'builder', "~> 0.0" # Gets the old version + require_gem 'builder', "~> 1.0" # Gets the new version +``` + +## Features + +* XML Comments are supported ... + +```ruby + xml_markup.comment! "This is a comment" + #=> +``` + +* XML processing instructions are supported ... + +```ruby + xml_markup.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8" + #=> +``` + + If the processing instruction is omitted, it defaults to "xml". + When the processing instruction is "xml", the defaults attributes + are: + + version: 1.0 + encoding: "UTF-8" + + (NOTE: if the encoding is set to "UTF-8" and $KCODE is set to + "UTF8", then Builder will emit UTF-8 encoded strings rather than + encoding non-ASCII characters as entities.) + +* XML entity declarations are now supported to a small degree. + +```ruby + xml_markup.declare! :DOCTYPE, :chapter, :SYSTEM, "../dtds/chapter.dtd" + #=> +``` + + The parameters to a declare! method must be either symbols or + strings. Symbols are inserted without quotes, and strings are + inserted with double quotes. Attribute-like arguments in hashes are + not allowed. + + If you need to have an argument to declare! be inserted without + quotes, but the argument does not conform to the typical Ruby + syntax for symbols, then use the :"string" form to specify a symbol. + + For example: + +```ruby + xml_markup.declare! :ELEMENT, :chapter, :"(title,para+)" + #=> +``` + + Nested entity declarations are allowed. For example: + +```ruby + @xml_markup.declare! :DOCTYPE, :chapter do |x| + x.declare! :ELEMENT, :chapter, :"(title,para+)" + x.declare! :ELEMENT, :title, :"(#PCDATA)" + x.declare! :ELEMENT, :para, :"(#PCDATA)" + end + + #=> + + + + + ]> +``` + +* Some support for XML namespaces is now available. If the first + argument to a tag call is a symbol, it will be joined to the tag to + produce a namespace:tag combination. It is easier to show this than + describe it. + +```ruby + xml.SOAP :Envelope do ... end +``` + + Just put a space before the colon in a namespace to produce the + right form for builder (e.g. "SOAP:Envelope" => + "xml.SOAP :Envelope") + +* String attribute values are now escaped by default by + Builder (NOTE: this is _new_ behavior as of version 2.0). + + However, occasionally you need to use entities in attribute values. + Using a symbol (rather than a string) for an attribute value will + cause Builder to not run its quoting/escaping algorithm on that + particular value. + + (Note: The +escape_attrs+ option for builder is now + obsolete). + + Example: + +```ruby + xml = Builder::XmlMarkup.new + xml.sample(:escaped=>"This&That", :unescaped=>:"Here&There") + xml.target! => + +``` + +* UTF-8 Support + + Builder correctly translates UTF-8 characters into valid XML. (New + in version 2.0.0). Thanks to Sam Ruby for the translation code. + + You can get UTF-8 encoded output by making sure that the XML + encoding is set to "UTF-8" and that the $KCODE variable is set to + "UTF8". + +```ruby + $KCODE = 'UTF8' + xml = Builder::Markup.new + xml.instruct!(:xml, :encoding => "UTF-8") + xml.sample("Iñtërnâtiônàl") + xml.target! => + "Iñtërnâtiônàl" +``` + +## Links + +| Description | Link | +| :----: | :----: | +| Documents | http://builder.rubyforge.org/ | +| Github Clone | git://github.com/jimweirich/builder.git | +| Issue / Bug Reports | https://github.com/jimweirich/builder/issues?state=open | + +## Contact + +| Description | Value | +| :----: | :----: | +| Author | Jim Weirich | +| Email | jim.weirich@gmail.com | +| Home Page | http://onestepback.org | +| License | MIT Licence (http://www.opensource.org/licenses/mit-license.html) | diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/Rakefile b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/Rakefile new file mode 100644 index 0000000..b082fbe --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/Rakefile @@ -0,0 +1,195 @@ +# Rakefile for rake -*- ruby -*- + +# Copyright 2004, 2005, 2006 by Jim Weirich (jim@weirichhouse.org). +# All rights reserved. + +# Permission is granted for use, copying, modification, distribution, +# and distribution of modified versions of this work as long as the +# above copyright notice is included. + +require 'rake/clean' +require 'rake/testtask' +begin + require 'rubygems' + require 'rubygems/package_task' + require 'rdoc/task' +rescue Exception + nil +end + +require './lib/builder/version' + +# Determine the current version of the software + +CLOBBER.include('pkg', 'html') +CLEAN.include('pkg/builder-*').include('pkg/blankslate-*').exclude('pkg/*.gem') + +PKG_VERSION = Builder::VERSION + +SRC_RB = FileList['lib/**/*.rb'] + +# The default task is run if rake is given no explicit arguments. + +desc "Default Task" +task :default => :test_all + +# Test Tasks --------------------------------------------------------- + +desc "Run all tests" +task :test_all => [:test_units] +task :ta => [:test_all] + +task :tu => [:test_units] + +Rake::TestTask.new("test_units") do |t| + t.test_files = FileList['test/test*.rb'] + t.libs << "." + t.verbose = false +end + +# Create a task to build the RDOC documentation tree. + +if defined?(RDoc) + rd = RDoc::Task.new("rdoc") { |rdoc| + rdoc.rdoc_dir = 'html' + rdoc.title = "Builder for Markup" + rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README.rdoc' + rdoc.rdoc_files.include('lib/**/*.rb', '[A-Z]*', 'doc/**/*.rdoc').exclude("TAGS") + rdoc.template = 'doc/jamis.rb' + } +else + rd = Struct.new(:rdoc_files).new([]) +end + +# ==================================================================== +# Create a task that will package the Rake software into distributable +# gem files. + +PKG_FILES = FileList[ + '[A-Z]*', + 'doc/**/*', + 'lib/**/*.rb', + 'test/**/*.rb', + 'rakelib/**/*' +] +PKG_FILES.exclude('test/test_cssbuilder.rb') +PKG_FILES.exclude('lib/builder/css.rb') +PKG_FILES.exclude('TAGS') + +BLANKSLATE_FILES = FileList[ + 'lib/blankslate.rb', + 'test/test_blankslate.rb' +] + +if ! defined?(Gem) + puts "Package Target requires RubyGEMs" +else + spec = Gem::Specification.new do |s| + + #### Basic information. + + s.name = 'builder' + s.version = PKG_VERSION + s.summary = "Builders for MarkUp." + s.description = %{\ +Builder provides a number of builder objects that make creating structured data +simple to do. Currently the following builder objects are supported: + +* XML Markup +* XML Events +} + + s.files = PKG_FILES.to_a + s.require_path = 'lib' + + s.test_files = PKG_FILES.select { |fn| fn =~ /^test\/test/ } + + s.has_rdoc = true + s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a + s.rdoc_options << + '--title' << 'Builder -- Easy XML Building' << + '--main' << 'README.rdoc' << + '--line-numbers' + + s.author = "Jim Weirich" + s.email = "jim.weirich@gmail.com" + s.homepage = "http://onestepback.org" + s.license = 'MIT' + end + + blankslate_spec = Gem::Specification.new do |s| + + #### Basic information. + + s.name = 'blankslate' + s.version = PKG_VERSION + s.summary = "Blank Slate base class." + s.description = %{\ +BlankSlate provides a base class where almost all of the methods from Object and +Kernel have been removed. This is useful when providing proxy object and other +classes that make heavy use of method_missing. +} + + s.files = BLANKSLATE_FILES.to_a + s.require_path = 'lib' + + s.test_files = PKG_FILES.select { |fn| fn =~ /^test\/test/ } + + s.has_rdoc = true + s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a + s.rdoc_options << + '--title' << 'BlankSlate -- Base Class for building proxies.' << + '--main' << 'README.rdoc' << + '--line-numbers' + + s.author = "Jim Weirich" + s.email = "jim.weirich@gmail.com" + s.homepage = "http://onestepback.org" + s.license = 'MIT' + end + + namespace 'builder' do + Gem::PackageTask.new(spec) do |t| + t.need_tar = false + end + end + + namespace 'blankslate' do + Gem::PackageTask.new(blankslate_spec) do |t| + t.need_tar = false + end + end + + task :package => [:remove_tags, 'builder:package', 'blankslate:package'] +end + +task :remove_tags do + rm "TAGS" rescue nil +end + +# RCov --------------------------------------------------------------- +begin + require 'rcov/rcovtask' + + Rcov::RcovTask.new do |t| + t.libs << "test" + t.rcov_opts = [ + '-xRakefile', '--text-report' + ] + t.test_files = FileList[ + 'test/test*.rb' + ] + t.output_dir = 'coverage' + t.verbose = true + end +rescue LoadError + # No rcov available +end + +desc "Install the jamis RDoc template" +task :install_jamis_template do + require 'rbconfig' + dest_dir = File.join(Config::CONFIG['rubylibdir'], "rdoc/generators/template/html") + fail "Unabled to write to #{dest_dir}" unless File.writable?(dest_dir) + install "doc/jamis.rb", dest_dir, :verbose => true +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/doc/jamis.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/doc/jamis.rb new file mode 100644 index 0000000..a00b583 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/doc/jamis.rb @@ -0,0 +1,591 @@ +module RDoc +module Page + +FONTS = "\"Bitstream Vera Sans\", Verdana, Arial, Helvetica, sans-serif" + +STYLE = < pre { + padding: 0.5em; + border: 1px dotted black; + background: #FFE; +} + +CSS + +XHTML_PREAMBLE = %{ + +} + +HEADER = XHTML_PREAMBLE + < + + %title% + + + + + + + +ENDHEADER + +FILE_PAGE = < + + + + +
File
%short_name%
+ + + + + + + + + +
Path:%full_path% +IF:cvsurl +  (CVS) +ENDIF:cvsurl +
Modified:%dtm_modified%
+
+ +
+HTML + +################################################################### + +CLASS_PAGE = < + %classmod%
%full_name% + + + + + + +IF:parent + + + + +ENDIF:parent +
In: +START:infiles +HREF:full_path_url:full_path: +IF:cvsurl + (CVS) +ENDIF:cvsurl +END:infiles +
Parent: +IF:par_url + +ENDIF:par_url +%parent% +IF:par_url + +ENDIF:par_url +
+ + + +HTML + +################################################################### + +METHOD_LIST = < +IF:diagram +
+ %diagram% +
+ENDIF:diagram + +IF:description +
%description%
+ENDIF:description + +IF:requires +
Required Files
+
    +START:requires +
  • HREF:aref:name:
  • +END:requires +
+ENDIF:requires + +IF:toc +
Contents
+ +ENDIF:toc + +IF:methods +
Methods
+
    +START:methods +
  • HREF:aref:name:
  • +END:methods +
+ENDIF:methods + +IF:includes +
Included Modules
+
    +START:includes +
  • HREF:aref:name:
  • +END:includes +
+ENDIF:includes + +START:sections +IF:sectitle + +IF:seccomment +
+%seccomment% +
+ENDIF:seccomment +ENDIF:sectitle + +IF:classlist +
Classes and Modules
+ %classlist% +ENDIF:classlist + +IF:constants +
Constants
+ +START:constants + + + + + +IF:desc + + + + +ENDIF:desc +END:constants +
%name%=%value%
 %desc%
+ENDIF:constants + +IF:attributes +
Attributes
+ +START:attributes + + + + + +END:attributes +
+IF:rw +[%rw%] +ENDIF:rw + %name%%a_desc%
+ENDIF:attributes + +IF:method_list +START:method_list +IF:methods +
%type% %category% methods
+START:methods +
+
+IF:callseq + %callseq% +ENDIF:callseq +IFNOT:callseq + %name%%params% +ENDIF:callseq +IF:codeurl +[ source ] +ENDIF:codeurl +
+IF:m_desc +
+ %m_desc% +
+ENDIF:m_desc +IF:aka +
+ This method is also aliased as +START:aka + %name% +END:aka +
+ENDIF:aka +IF:sourcecode +
+ +
+
+%sourcecode%
+
+
+
+ENDIF:sourcecode +
+END:methods +ENDIF:methods +END:method_list +ENDIF:method_list +END:sections + +HTML + +FOOTER = < + +ENDFOOTER + +BODY = HEADER + < + +
+ #{METHOD_LIST} +
+ + #{FOOTER} +ENDBODY + +########################## Source code ########################## + +SRC_PAGE = XHTML_PREAMBLE + < +%title% + + + + +
%code%
+ + +HTML + +########################## Index ################################ + +FR_INDEX_BODY = < + + + + + + + +
+START:entries +%name%
+END:entries +
+ +HTML + +CLASS_INDEX = FILE_INDEX +METHOD_INDEX = FILE_INDEX + +INDEX = XHTML_PREAMBLE + < + + %title% + + + + + + + + + +IF:inline_source + +ENDIF:inline_source +IFNOT:inline_source + + + + +ENDIF:inline_source + + <body bgcolor="white"> + Click <a href="html/index.html">here</a> for a non-frames + version of this page. + </body> + + + + +HTML + +end +end + + diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/doc/releases/builder-1.2.4.rdoc b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/doc/releases/builder-1.2.4.rdoc new file mode 100644 index 0000000..a1cf54f --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/doc/releases/builder-1.2.4.rdoc @@ -0,0 +1,31 @@ += Builder 1.2.4 Released. + +Added a "CDATA" method to the XML Markup builder (from Josh Knowles). + +== What is Builder? + +Builder::XmlMarkup allows easy programmatic creation of XML markup. +For example: + + builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2) + builder.person { |b| b.name("Jim"); b.phone("555-1234") } + puts builder.target! + +will generate: + + + Jim + 555-1234 + + +== Availability + +The easiest way to get and install builder is via RubyGems ... + + gem install builder (you may need root/admin privileges) + +== Thanks + +* Josh Knowles for the cdata! patch. + +-- Jim Weirich diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/doc/releases/builder-2.0.0.rdoc b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/doc/releases/builder-2.0.0.rdoc new file mode 100644 index 0000000..ed9e086 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/doc/releases/builder-2.0.0.rdoc @@ -0,0 +1,46 @@ += Builder 2.0.0 Released. + +== Changes in 2.0.0 + +* UTF-8 characters in data are now correctly translated to their XML + equivalents. (Thanks to Sam Ruby) + +* Attribute values are now escaped by default. See the README + file for details. + +NOTE: The escaping attribute values by default is different +than in previous releases of Builder. This makes version 2.0.0 +somewhat incompatible with the 1.x series of Builder. If you use "&", +"<", or ">" in attributes values, you may have to change your +code. (Essentially you remove the manual escaping. The new way is +easier, believe me). + +== What is Builder? + +Builder::XmlMarkup is a library that allows easy programmatic creation +of XML markup. For example: + + builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2) + builder.person { |b| b.name("Jim"); b.phone("555-1234") } + +will generate: + + + Jim + 555-1234 + + +== Availability + +The easiest way to get and install builder is via RubyGems ... + + gem install builder (you may need root/admin privileges) + +== Thanks + +* Sam Ruby for the XChar module and the related UTF-8 translation + tools. +* Also to Sam Ruby for gently persuading me to start quoting attribute + values. + +-- Jim Weirich diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/doc/releases/builder-2.1.1.rdoc b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/doc/releases/builder-2.1.1.rdoc new file mode 100755 index 0000000..dbbf121 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/doc/releases/builder-2.1.1.rdoc @@ -0,0 +1,58 @@ += Builder 2.1.1 Released. + +Release 2.1.1 of Builder is mainly a bug fix release. + +== Changes in 2.1.1 + +* Added reveal capability to BlankSlate. + +* Fixed a bug in BlankSlate where including a module into Object could + cause methods to leak into BlankSlate. + +* Fixed typo in XmlMarkup class docs (from Martin Fowler). + +* Fixed test on private methods to differentiate between targetted and + untargetted private methods. + +* Removed legacy capture of @self in XmlBase (@self was used back when + we used instance eval). + +* Added additional tests for global functions (both direct and + included). + +* Several misc internal cleanups, including rearranging the source + code tree. + +NOTE: The escaping attribute values by default is different +than in previous releases of Builder. This makes version 2.0.x +somewhat incompatible with the 1.x series of Builder. If you use "&", +"<", or ">" in attributes values, you may have to change your +code. (Essentially you remove the manual escaping. The new way is +easier, believe me). + +== What is Builder? + +Builder::XmlMarkup is a library that allows easy programmatic creation +of XML markup. For example: + + builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2) + builder.person { |b| b.name("Jim"); b.phone("555-1234") } + +will generate: + + + Jim + 555-1234 + + +== Availability + +The easiest way to get and install builder is via RubyGems ... + + gem install builder (you may need root/admin privileges) + +== Thanks + +* Martin Fowler for spotting some typos in the documentation. + +-- Jim Weirich diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/blankslate.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/blankslate.rb new file mode 100644 index 0000000..931c8a7 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/blankslate.rb @@ -0,0 +1,137 @@ +#!/usr/bin/env ruby +#-- +# Copyright 2004, 2006 by Jim Weirich (jim@weirichhouse.org). +# All rights reserved. + +# Permission is granted for use, copying, modification, distribution, +# and distribution of modified versions of this work as long as the +# above copyright notice is included. +#++ + +class String + if instance_methods.first.is_a?(Symbol) + def _blankslate_as_name + to_sym + end + else + def _blankslate_as_name + self + end + end +end + +class Symbol + if instance_methods.first.is_a?(Symbol) + def _blankslate_as_name + self + end + else + def _blankslate_as_name + to_s + end + end +end + +###################################################################### +# BlankSlate provides an abstract base class with no predefined +# methods (except for \_\_send__ and \_\_id__). +# BlankSlate is useful as a base class when writing classes that +# depend upon method_missing (e.g. dynamic proxies). +# +class BlankSlate + class << self + + # Hide the method named +name+ in the BlankSlate class. Don't + # hide +instance_eval+ or any method beginning with "__". + def hide(name) + warn_level = $VERBOSE + $VERBOSE = nil + if instance_methods.include?(name._blankslate_as_name) && + name !~ /^(__|instance_eval$)/ + @hidden_methods ||= {} + @hidden_methods[name.to_sym] = instance_method(name) + undef_method name + end + ensure + $VERBOSE = warn_level + end + + def find_hidden_method(name) + @hidden_methods ||= {} + @hidden_methods[name] || superclass.find_hidden_method(name) + end + + # Redefine a previously hidden method so that it may be called on a blank + # slate object. + def reveal(name) + hidden_method = find_hidden_method(name) + fail "Don't know how to reveal method '#{name}'" unless hidden_method + define_method(name, hidden_method) + end + end + + instance_methods.each { |m| hide(m) } +end + +###################################################################### +# Since Ruby is very dynamic, methods added to the ancestors of +# BlankSlate after BlankSlate is defined will show up in the +# list of available BlankSlate methods. We handle this by defining a +# hook in the Object and Kernel classes that will hide any method +# defined after BlankSlate has been loaded. +# +module Kernel + class << self + alias_method :blank_slate_method_added, :method_added + + # Detect method additions to Kernel and remove them in the + # BlankSlate class. + def method_added(name) + result = blank_slate_method_added(name) + return result if self != Kernel + BlankSlate.hide(name) + result + end + end +end + +###################################################################### +# Same as above, except in Object. +# +class Object + class << self + alias_method :blank_slate_method_added, :method_added + + # Detect method additions to Object and remove them in the + # BlankSlate class. + def method_added(name) + result = blank_slate_method_added(name) + return result if self != Object + BlankSlate.hide(name) + result + end + + def find_hidden_method(name) + nil + end + end +end + +###################################################################### +# Also, modules included into Object need to be scanned and have their +# instance methods removed from blank slate. In theory, modules +# included into Kernel would have to be removed as well, but a +# "feature" of Ruby prevents late includes into modules from being +# exposed in the first place. +# +class Module + alias blankslate_original_append_features append_features + def append_features(mod) + result = blankslate_original_append_features(mod) + return result if mod != Object + instance_methods.each do |name| + BlankSlate.hide(name) + end + result + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder.rb new file mode 100644 index 0000000..9719277 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder.rb @@ -0,0 +1,13 @@ +#!/usr/bin/env ruby + +#-- +# Copyright 2004 by Jim Weirich (jim@weirichhouse.org). +# All rights reserved. + +# Permission is granted for use, copying, modification, distribution, +# and distribution of modified versions of this work as long as the +# above copyright notice is included. +#++ + +require 'builder/xmlmarkup' +require 'builder/xmlevents' diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/blankslate.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/blankslate.rb new file mode 100644 index 0000000..67d2f24 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/blankslate.rb @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby +#-- +# Copyright 2004, 2006 by Jim Weirich (jim@weirichhouse.org). +# All rights reserved. + +# Permission is granted for use, copying, modification, distribution, +# and distribution of modified versions of this work as long as the +# above copyright notice is included. +#++ + +###################################################################### +# BlankSlate has been promoted to a top level name and is now +# available as a standalone gem. We make the name available in the +# Builder namespace for compatibility. +# +module Builder + if Object::const_defined?(:BasicObject) + BlankSlate = ::BasicObject + else + require 'blankslate' + BlankSlate = ::BlankSlate + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/version.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/version.rb new file mode 100644 index 0000000..cbe7bc4 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/version.rb @@ -0,0 +1,8 @@ +module Builder + VERSION_NUMBERS = [ + VERSION_MAJOR = 3, + VERSION_MINOR = 2, + VERSION_BUILD = 2, + ] + VERSION = VERSION_NUMBERS.join(".") +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/xchar.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/xchar.rb new file mode 100644 index 0000000..c7daa48 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/xchar.rb @@ -0,0 +1,197 @@ +#!/usr/bin/env ruby + +# The XChar library is provided courtesy of Sam Ruby (See +# http://intertwingly.net/stories/2005/09/28/xchar.rb) + +# -------------------------------------------------------------------- + +# If the Builder::XChar module is not currently defined, fail on any +# name clashes in standard library classes. + +module Builder + def self.check_for_name_collision(klass, method_name, defined_constant=nil) + if klass.method_defined?(method_name.to_s) + fail RuntimeError, + "Name Collision: Method '#{method_name}' is already defined in #{klass}" + end + end +end + +if ! defined?(Builder::XChar) and ! String.method_defined?(:encode) + Builder.check_for_name_collision(String, "to_xs") + Builder.check_for_name_collision(Fixnum, "xchr") +end + +###################################################################### +module Builder + + #################################################################### + # XML Character converter, from Sam Ruby: + # (see http://intertwingly.net/stories/2005/09/28/xchar.rb). + # + module XChar # :nodoc: + + # See + # http://intertwingly.net/stories/2004/04/14/i18n.html#CleaningWindows + # for details. + CP1252 = { # :nodoc: + 128 => 8364, # euro sign + 130 => 8218, # single low-9 quotation mark + 131 => 402, # latin small letter f with hook + 132 => 8222, # double low-9 quotation mark + 133 => 8230, # horizontal ellipsis + 134 => 8224, # dagger + 135 => 8225, # double dagger + 136 => 710, # modifier letter circumflex accent + 137 => 8240, # per mille sign + 138 => 352, # latin capital letter s with caron + 139 => 8249, # single left-pointing angle quotation mark + 140 => 338, # latin capital ligature oe + 142 => 381, # latin capital letter z with caron + 145 => 8216, # left single quotation mark + 146 => 8217, # right single quotation mark + 147 => 8220, # left double quotation mark + 148 => 8221, # right double quotation mark + 149 => 8226, # bullet + 150 => 8211, # en dash + 151 => 8212, # em dash + 152 => 732, # small tilde + 153 => 8482, # trade mark sign + 154 => 353, # latin small letter s with caron + 155 => 8250, # single right-pointing angle quotation mark + 156 => 339, # latin small ligature oe + 158 => 382, # latin small letter z with caron + 159 => 376, # latin capital letter y with diaeresis + } + + # See http://www.w3.org/TR/REC-xml/#dt-chardata for details. + PREDEFINED = { + 38 => '&', # ampersand + 60 => '<', # left angle bracket + 62 => '>', # right angle bracket + } + + # See http://www.w3.org/TR/REC-xml/#charsets for details. + VALID = [ + 0x9, 0xA, 0xD, + (0x20..0xD7FF), + (0xE000..0xFFFD), + (0x10000..0x10FFFF) + ] + + # http://www.fileformat.info/info/unicode/char/fffd/index.htm + REPLACEMENT_CHAR = + if String.method_defined?(:encode) + "\uFFFD" + elsif $KCODE == 'UTF8' + "\xEF\xBF\xBD" + else + '*' + end + end + +end + + +if String.method_defined?(:encode) + module Builder + module XChar # :nodoc: + CP1252_DIFFERENCES, UNICODE_EQUIVALENT = Builder::XChar::CP1252.each. + inject([[],[]]) {|(domain,range),(key,value)| + [domain << key,range << value] + }.map {|seq| seq.pack('U*').force_encoding('utf-8')} + + XML_PREDEFINED = Regexp.new('[' + + Builder::XChar::PREDEFINED.keys.pack('U*').force_encoding('utf-8') + + ']') + + INVALID_XML_CHAR = Regexp.new('[^'+ + Builder::XChar::VALID.map { |item| + case item + when Fixnum + [item].pack('U').force_encoding('utf-8') + when Range + [item.first, '-'.ord, item.last].pack('UUU').force_encoding('utf-8') + end + }.join + + ']') + + ENCODING_BINARY = Encoding.find('BINARY') + ENCODING_UTF8 = Encoding.find('UTF-8') + ENCODING_ISO1 = Encoding.find('ISO-8859-1') + + # convert a string to valid UTF-8, compensating for a number of + # common errors. + def XChar.unicode(string) + if string.encoding == ENCODING_BINARY + if string.ascii_only? + string + else + string = string.clone.force_encoding(ENCODING_UTF8) + if string.valid_encoding? + string + else + string.encode(ENCODING_UTF8, ENCODING_ISO1) + end + end + + elsif string.encoding == ENCODING_UTF8 + if string.valid_encoding? + string + else + string.encode(ENCODING_UTF8, ENCODING_ISO1) + end + + else + string.encode(ENCODING_UTF8) + end + end + + # encode a string per XML rules + def XChar.encode(string) + unicode(string). + tr(CP1252_DIFFERENCES, UNICODE_EQUIVALENT). + gsub(INVALID_XML_CHAR, REPLACEMENT_CHAR). + gsub(XML_PREDEFINED) {|c| PREDEFINED[c.ord]} + end + end + end + +else + + ###################################################################### + # Enhance the Fixnum class with a XML escaped character conversion. + # + class Fixnum + XChar = Builder::XChar if ! defined?(XChar) + + # XML escaped version of chr. When escape is set to false + # the CP1252 fix is still applied but utf-8 characters are not + # converted to character entities. + def xchr(escape=true) + n = XChar::CP1252[self] || self + case n when *XChar::VALID + XChar::PREDEFINED[n] or + (n<128 ? n.chr : (escape ? "&##{n};" : [n].pack('U*'))) + else + Builder::XChar::REPLACEMENT_CHAR + end + end + end + + + ###################################################################### + # Enhance the String class with a XML escaped character version of + # to_s. + # + class String + # XML escaped version of to_s. When escape is set to false + # the CP1252 fix is still applied but utf-8 characters are not + # converted to character entities. + def to_xs(escape=true) + unpack('U*').map {|n| n.xchr(escape)}.join # ASCII, UTF-8 + rescue + unpack('C*').map {|n| n.xchr}.join # ISO-8859-1, WIN-1252 + end + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/xmlbase.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/xmlbase.rb new file mode 100644 index 0000000..8f03a82 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/xmlbase.rb @@ -0,0 +1,199 @@ +#!/usr/bin/env ruby + +require 'builder/blankslate' + +module Builder + + # Generic error for builder + class IllegalBlockError < RuntimeError; end + + # XmlBase is a base class for building XML builders. See + # Builder::XmlMarkup and Builder::XmlEvents for examples. + class XmlBase < BlankSlate + + class << self + attr_accessor :cache_method_calls + end + + # Create an XML markup builder. + # + # out :: Object receiving the markup. +out+ must respond to + # <<. + # indent :: Number of spaces used for indentation (0 implies no + # indentation and no line breaks). + # initial :: Level of initial indentation. + # encoding :: When encoding and $KCODE are set to 'utf-8' + # characters aren't converted to character entities in + # the output stream. + def initialize(indent=0, initial=0, encoding='utf-8') + @indent = indent + @level = initial + @encoding = encoding.downcase + end + + def explicit_nil_handling? + @explicit_nil_handling + end + + # Create a tag named +sym+. Other than the first argument which + # is the tag name, the arguments are the same as the tags + # implemented via method_missing. + def tag!(sym, *args, &block) + text = nil + attrs = nil + sym = "#{sym}:#{args.shift}" if args.first.kind_of?(::Symbol) + sym = sym.to_sym unless sym.class == ::Symbol + args.each do |arg| + case arg + when ::Hash + attrs ||= {} + attrs.merge!(arg) + when nil + attrs ||= {} + attrs.merge!({:nil => true}) if explicit_nil_handling? + else + text ||= '' + text << arg.to_s + end + end + if block + unless text.nil? + ::Kernel::raise ::ArgumentError, + "XmlMarkup cannot mix a text argument with a block" + end + _indent + _start_tag(sym, attrs) + _newline + begin + _nested_structures(block) + ensure + _indent + _end_tag(sym) + _newline + end + elsif text.nil? + _indent + _start_tag(sym, attrs, true) + _newline + else + _indent + _start_tag(sym, attrs) + text! text + _end_tag(sym) + _newline + end + @target + end + + # Create XML markup based on the name of the method. This method + # is never invoked directly, but is called for each markup method + # in the markup block that isn't cached. + def method_missing(sym, *args, &block) + cache_method_call(sym) if ::Builder::XmlBase.cache_method_calls + tag!(sym, *args, &block) + end + + # Append text to the output target. Escape any markup. May be + # used within the markup brackets as: + # + # builder.p { |b| b.br; b.text! "HI" } #=>


HI

+ def text!(text) + _text(_escape(text)) + end + + # Append text to the output target without escaping any markup. + # May be used within the markup brackets as: + # + # builder.p { |x| x << "
HI" } #=>


HI

+ # + # This is useful when using non-builder enabled software that + # generates strings. Just insert the string directly into the + # builder without changing the inserted markup. + # + # It is also useful for stacking builder objects. Builders only + # use << to append to the target, so by supporting this + # method/operation builders can use other builders as their + # targets. + def <<(text) + _text(text) + end + + # For some reason, nil? is sent to the XmlMarkup object. If nil? + # is not defined and method_missing is invoked, some strange kind + # of recursion happens. Since nil? won't ever be an XML tag, it + # is pretty safe to define it here. (Note: this is an example of + # cargo cult programming, + # cf. http://fishbowl.pastiche.org/2004/10/13/cargo_cult_programming). + def nil? + false + end + + private + + require 'builder/xchar' + if ::String.method_defined?(:encode) + def _escape(text) + result = XChar.encode(text) + begin + encoding = ::Encoding::find(@encoding) + raise Exception if encoding.dummy? + result.encode(encoding) + rescue + # if the encoding can't be supported, use numeric character references + result. + gsub(/[^\u0000-\u007F]/) {|c| "&##{c.ord};"}. + force_encoding('ascii') + end + end + else + def _escape(text) + if (text.method(:to_xs).arity == 0) + text.to_xs + else + text.to_xs((@encoding != 'utf-8' or $KCODE != 'UTF8')) + end + end + end + + def _escape_attribute(text) + _escape(text).gsub("\n", " ").gsub("\r", " "). + gsub(%r{"}, '"') # " WART + end + + def _newline + return if @indent == 0 + text! "\n" + end + + def _indent + return if @indent == 0 || @level == 0 + text!(" " * (@level * @indent)) + end + + def _nested_structures(block) + @level += 1 + block.call(self) + ensure + @level -= 1 + end + + # If XmlBase.cache_method_calls = true, we dynamicly create the method + # missed as an instance method on the XMLBase object. Because XML + # documents are usually very repetative in nature, the next node will + # be handled by the new method instead of method_missing. As + # method_missing is very slow, this speeds up document generation + # significantly. + def cache_method_call(sym) + class << self; self; end.class_eval do + unless method_defined?(sym) + define_method(sym) do |*args, &block| + tag!(sym, *args, &block) + end + end + end + end + end + + XmlBase.cache_method_calls = true + +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/xmlevents.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/xmlevents.rb new file mode 100644 index 0000000..91fcd21 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/xmlevents.rb @@ -0,0 +1,63 @@ +#!/usr/bin/env ruby + +#-- +# Copyright 2004 by Jim Weirich (jim@weirichhouse.org). +# All rights reserved. + +# Permission is granted for use, copying, modification, distribution, +# and distribution of modified versions of this work as long as the +# above copyright notice is included. +#++ + +require 'builder/xmlmarkup' + +module Builder + + # Create a series of SAX-like XML events (e.g. start_tag, end_tag) + # from the markup code. XmlEvent objects are used in a way similar + # to XmlMarkup objects, except that a series of events are generated + # and passed to a handler rather than generating character-based + # markup. + # + # Usage: + # xe = Builder::XmlEvents.new(hander) + # xe.title("HI") # Sends start_tag/end_tag/text messages to the handler. + # + # Indentation may also be selected by providing value for the + # indentation size and initial indentation level. + # + # xe = Builder::XmlEvents.new(handler, indent_size, initial_indent_level) + # + # == XML Event Handler + # + # The handler object must expect the following events. + # + # [start_tag(tag, attrs)] + # Announces that a new tag has been found. +tag+ is the name of + # the tag and +attrs+ is a hash of attributes for the tag. + # + # [end_tag(tag)] + # Announces that an end tag for +tag+ has been found. + # + # [text(text)] + # Announces that a string of characters (+text+) has been found. + # A series of characters may be broken up into more than one + # +text+ call, so the client cannot assume that a single + # callback contains all the text data. + # + class XmlEvents < XmlMarkup + def text!(text) + @target.text(text) + end + + def _start_tag(sym, attrs, end_too=false) + @target.start_tag(sym, attrs) + _end_tag(sym) if end_too + end + + def _end_tag(sym) + @target.end_tag(sym) + end + end + +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/xmlmarkup.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/xmlmarkup.rb new file mode 100644 index 0000000..4730d09 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/lib/builder/xmlmarkup.rb @@ -0,0 +1,339 @@ +#!/usr/bin/env ruby +#-- +# Copyright 2004, 2005 by Jim Weirich (jim@weirichhouse.org). +# All rights reserved. + +# Permission is granted for use, copying, modification, distribution, +# and distribution of modified versions of this work as long as the +# above copyright notice is included. +#++ + +# Provide a flexible and easy to use Builder for creating XML markup. +# See XmlBuilder for usage details. + +require 'builder/xmlbase' + +module Builder + + # Create XML markup easily. All (well, almost all) methods sent to + # an XmlMarkup object will be translated to the equivalent XML + # markup. Any method with a block will be treated as an XML markup + # tag with nested markup in the block. + # + # Examples will demonstrate this easier than words. In the + # following, +xm+ is an +XmlMarkup+ object. + # + # xm.em("emphasized") # => emphasized + # xm.em { xm.b("emp & bold") } # => emph & bold + # xm.a("A Link", "href"=>"http://onestepback.org") + # # => A Link + # xm.div { xm.br } # =>

+ # xm.target("name"=>"compile", "option"=>"fast") + # # => + # # NOTE: order of attributes is not specified. + # + # xm.instruct! # + # xm.html { # + # xm.head { # + # xm.title("History") # History + # } # + # xm.body { # + # xm.comment! "HI" # + # xm.h1("Header") #

Header

+ # xm.p("paragraph") #

paragraph

+ # } # + # } # + # + # == Notes: + # + # * The order that attributes are inserted in markup tags is + # undefined. + # + # * Sometimes you wish to insert text without enclosing tags. Use + # the text! method to accomplish this. + # + # Example: + # + # xm.div { #
+ # xm.text! "line"; xm.br # line
+ # xm.text! "another line"; xmbr # another line
+ # } #
+ # + # * The special XML characters <, >, and & are converted to <, + # > and & automatically. Use the << operation to + # insert text without modification. + # + # * Sometimes tags use special characters not allowed in ruby + # identifiers. Use the tag! method to handle these + # cases. + # + # Example: + # + # xml.tag!("SOAP:Envelope") { ... } + # + # will produce ... + # + # ... " + # + # tag! will also take text and attribute arguments (after + # the tag name) like normal markup methods. (But see the next + # bullet item for a better way to handle XML namespaces). + # + # * Direct support for XML namespaces is now available. If the + # first argument to a tag call is a symbol, it will be joined to + # the tag to produce a namespace:tag combination. It is easier to + # show this than describe it. + # + # xml.SOAP :Envelope do ... end + # + # Just put a space before the colon in a namespace to produce the + # right form for builder (e.g. "SOAP:Envelope" => + # "xml.SOAP :Envelope") + # + # * XmlMarkup builds the markup in any object (called a _target_) + # that accepts the << method. If no target is given, + # then XmlMarkup defaults to a string target. + # + # Examples: + # + # xm = Builder::XmlMarkup.new + # result = xm.title("yada") + # # result is a string containing the markup. + # + # buffer = "" + # xm = Builder::XmlMarkup.new(buffer) + # # The markup is appended to buffer (using <<) + # + # xm = Builder::XmlMarkup.new(STDOUT) + # # The markup is written to STDOUT (using <<) + # + # xm = Builder::XmlMarkup.new + # x2 = Builder::XmlMarkup.new(:target=>xm) + # # Markup written to +x2+ will be send to +xm+. + # + # * Indentation is enabled by providing the number of spaces to + # indent for each level as a second argument to XmlBuilder.new. + # Initial indentation may be specified using a third parameter. + # + # Example: + # + # xm = Builder.new(:indent=>2) + # # xm will produce nicely formatted and indented XML. + # + # xm = Builder.new(:indent=>2, :margin=>4) + # # xm will produce nicely formatted and indented XML with 2 + # # spaces per indent and an over all indentation level of 4. + # + # builder = Builder::XmlMarkup.new(:target=>$stdout, :indent=>2) + # builder.name { |b| b.first("Jim"); b.last("Weirich) } + # # prints: + # # + # # Jim + # # Weirich + # # + # + # * The instance_eval implementation which forces self to refer to + # the message receiver as self is now obsolete. We now use normal + # block calls to execute the markup block. This means that all + # markup methods must now be explicitly send to the xml builder. + # For instance, instead of + # + # xml.div { strong("text") } + # + # you need to write: + # + # xml.div { xml.strong("text") } + # + # Although more verbose, the subtle change in semantics within the + # block was found to be prone to error. To make this change a + # little less cumbersome, the markup block now gets the markup + # object sent as an argument, allowing you to use a shorter alias + # within the block. + # + # For example: + # + # xml_builder = Builder::XmlMarkup.new + # xml_builder.div { |xml| + # xml.stong("text") + # } + # + class XmlMarkup < XmlBase + + # Create an XML markup builder. Parameters are specified by an + # option hash. + # + # :target => target_object:: + # Object receiving the markup. +target_object+ must respond to + # the <<(a_string) operator and return + # itself. The default target is a plain string target. + # + # :indent => indentation:: + # Number of spaces used for indentation. The default is no + # indentation and no line breaks. + # + # :margin => initial_indentation_level:: + # Amount of initial indentation (specified in levels, not + # spaces). + # + # :quote => :single:: + # Use single quotes for attributes rather than double quotes. + # + # :escape_attrs => OBSOLETE:: + # The :escape_attrs option is no longer supported by builder + # (and will be quietly ignored). String attribute values are + # now automatically escaped. If you need unescaped attribute + # values (perhaps you are using entities in the attribute + # values), then give the value as a Symbol. This allows much + # finer control over escaping attribute values. + # + def initialize(options={}) + indent = options[:indent] || 0 + margin = options[:margin] || 0 + @quote = (options[:quote] == :single) ? "'" : '"' + @explicit_nil_handling = options[:explicit_nil_handling] + super(indent, margin) + @target = options[:target] || "" + end + + # Return the target of the builder. + def target! + @target + end + + def comment!(comment_text) + _ensure_no_block ::Kernel::block_given? + _special("", comment_text, nil) + end + + # Insert an XML declaration into the XML markup. + # + # For example: + # + # xml.declare! :ELEMENT, :blah, "yada" + # # => + def declare!(inst, *args, &block) + _indent + @target << "" + _newline + end + + # Insert a processing instruction into the XML markup. E.g. + # + # For example: + # + # xml.instruct! + # #=> + # xml.instruct! :aaa, :bbb=>"ccc" + # #=> + # + # Note: If the encoding is setup to "UTF-8" and the value of + # $KCODE is "UTF8", then builder will emit UTF-8 encoded strings + # rather than the entity encoding normally used. + def instruct!(directive_tag=:xml, attrs={}) + _ensure_no_block ::Kernel::block_given? + if directive_tag == :xml + a = { :version=>"1.0", :encoding=>"UTF-8" } + attrs = a.merge attrs + @encoding = attrs[:encoding].downcase + end + _special( + "", + nil, + attrs, + [:version, :encoding, :standalone]) + end + + # Insert a CDATA section into the XML markup. + # + # For example: + # + # xml.cdata!("text to be included in cdata") + # #=> + # + def cdata!(text) + _ensure_no_block ::Kernel::block_given? + _special("", text.gsub(']]>', ']]]]>'), nil) + end + + private + + # NOTE: All private methods of a builder object are prefixed when + # a "_" character to avoid possible conflict with XML tag names. + + # Insert text directly in to the builder's target. + def _text(text) + @target << text + end + + # Insert special instruction. + def _special(open, close, data=nil, attrs=nil, order=[]) + _indent + @target << open + @target << data if data + _insert_attributes(attrs, order) if attrs + @target << close + _newline + end + + # Start an XML tag. If end_too is true, then the start + # tag is also the end tag (e.g.
+ def _start_tag(sym, attrs, end_too=false) + @target << "<#{sym}" + _insert_attributes(attrs) + @target << "/" if end_too + @target << ">" + end + + # Insert an ending tag. + def _end_tag(sym) + @target << "" + end + + # Insert the attributes (given in the hash). + def _insert_attributes(attrs, order=[]) + return if attrs.nil? + order.each do |k| + v = attrs[k] + @target << %{ #{k}=#{@quote}#{_attr_value(v)}#{@quote}} if v + end + attrs.each do |k, v| + @target << %{ #{k}=#{@quote}#{_attr_value(v)}#{@quote}} unless order.member?(k) # " WART + end + end + + def _attr_value(value) + case value + when ::Symbol + value.to_s + else + _escape_attribute(value.to_s) + end + end + + def _ensure_no_block(got_block) + if got_block + ::Kernel::raise IllegalBlockError.new( + "Blocks are not allowed on XML instructions" + ) + end + end + + end + +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/rakelib/publish.rake b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/rakelib/publish.rake new file mode 100644 index 0000000..9849e0d --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/rakelib/publish.rake @@ -0,0 +1,17 @@ +# Optional publish task for Rake + +require 'rake/contrib/sshpublisher' +require 'rake/contrib/rubyforgepublisher' + +publisher = Rake::CompositePublisher.new +publisher.add Rake::RubyForgePublisher.new('builder', 'jimweirich') +publisher.add Rake::SshFilePublisher.new( + 'linode', + 'htdocs/software/builder', + '.', + 'builder.blurb') + +desc "Publish the Documentation to RubyForge." +task :publish => [:rdoc] do + publisher.upload +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/rakelib/tags.rake b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/rakelib/tags.rake new file mode 100644 index 0000000..93b47df --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/rakelib/tags.rake @@ -0,0 +1,62 @@ +#!/usr/bin/env ruby + +module Tags + extend Rake::DSL if defined?(Rake::DSL) + + PROG = ENV['TAGS'] || 'ctags' + + RAKEFILES = FileList['Rakefile', '**/*.rake'] + + FILES = FileList['**/*.rb', '**/*.js'] + RAKEFILES + FILES.exclude('pkg', 'dist') + + PROJECT_DIR = ['.'] + + RVM_GEMDIR = File.join(`rvm gemdir`.strip, "gems") + SYSTEM_DIRS = File.exists?(RVM_GEMDIR) ? RVM_GEMDIR : [] + + module_function + + # Convert key_word to --key-word. + def keyword(key) + k = key.to_s.gsub(/_/, '-') + (k.length == 1) ? "-#{k}" : "--#{k}" + end + + # Run ctags command + def run(*args) + opts = { + :e => true, + :totals => true, + :recurse => true, + } + opts = opts.merge(args.pop) if args.last.is_a?(Hash) + command_args = opts.map { |k, v| + (v == true) ? keyword(k) : "#{keyword(k)}=#{v}" + }.join(" ") + sh %{#{Tags::PROG} #{command_args} #{args.join(' ')}} + end +end + +namespace "tags" do + desc "Generate an Emacs TAGS file" + task :emacs, [:all] => Tags::FILES do |t, args| + puts "Making Emacs TAGS file" + verbose(true) do + Tags.run(Tags::PROJECT_DIR) + Tags.run(Tags::RAKEFILES, + :language_force => "ruby", + :append => true) + if args.all + Tags::SYSTEM_DIRS.each do |dir| + Tags.run(dir, + :language_force => "ruby", + :append => true) + end + end + end + end +end + +desc "Generate the TAGS file" +task :tags, [:all] => ["tags:emacs"] diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/performance.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/performance.rb new file mode 100644 index 0000000..e764205 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/performance.rb @@ -0,0 +1,41 @@ +#!/usr/bin/env ruby +# encoding: iso-8859-1 + +#-- +# Portions copyright 2004 by Jim Weirich (jim@weirichhouse.org). +# Portions copyright 2005 by Sam Ruby (rubys@intertwingly.net). +# All rights reserved. + +# Permission is granted for use, copying, modification, distribution, +# and distribution of modified versions of this work as long as the +# above copyright notice is included. +#++ + +require 'builder/xmlmarkup' +require 'benchmark' + +text = "This is a test of the new xml markup. I�t�rn�ti�n�liz�ti�n\n" * 10000 + +include Benchmark # we need the CAPTION and FMTSTR constants +include Builder +n = 50 +Benchmark.benchmark do |bm| + tf = bm.report("base") { + n.times do + x = XmlMarkup.new + x.text(text) + x.target! + end + } + def XmlMarkup._escape(text) + text.to_xs + end + tf = bm.report("to_xs") { + n.times do + x = XmlMarkup.new + x.text(text) + x.target! + end + } +end + diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/preload.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/preload.rb new file mode 100644 index 0000000..395e043 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/preload.rb @@ -0,0 +1,39 @@ +#!/usr/bin/env ruby + +#-- +# Portions copyright 2004 by Jim Weirich (jim@weirichhouse.org). +# Portions copyright 2005 by Sam Ruby (rubys@intertwingly.net). +# All rights reserved. + +# Permission is granted for use, copying, modification, distribution, +# and distribution of modified versions of this work as long as the +# above copyright notice is included. +#++ + +# We are defining method_added in Kernel and Object so that when +# BlankSlate overrides them later, we can verify that it correctly +# calls the older hooks. + +module Kernel + class << self + attr_reader :k_added_names + alias_method :preload_method_added, :method_added + def method_added(name) + preload_method_added(name) + @k_added_names ||= [] + @k_added_names << name + end + end +end + +class Object + class << self + attr_reader :o_added_names + alias_method :preload_method_added, :method_added + def method_added(name) + preload_method_added(name) + @o_added_names ||= [] + @o_added_names << name + end + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_blankslate.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_blankslate.rb new file mode 100644 index 0000000..ea38ced --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_blankslate.rb @@ -0,0 +1,217 @@ +#!/usr/bin/env ruby + +#-- +# Portions copyright 2004 by Jim Weirich (jim@weirichhouse.org). +# Portions copyright 2005 by Sam Ruby (rubys@intertwingly.net). +# All rights reserved. + +# Permission is granted for use, copying, modification, distribution, +# and distribution of modified versions of this work as long as the +# above copyright notice is included. +#++ + +require 'test/unit' +require 'test/preload' +require 'blankslate' +require 'stringio' + +# Methods to be introduced into the Object class late. +module LateObject + def late_object + 33 + end + def LateObject.included(mod) + # Modules defining an included method should not prevent blank + # slate erasure! + end +end + +# Methods to be introduced into the Kernel module late. +module LateKernel + def late_kernel + 44 + end + def LateKernel.included(mod) + # Modules defining an included method should not prevent blank + # slate erasure! + end +end + +# Introduce some late methods (both module and direct) into the Kernel +# module. +module Kernel + include LateKernel + + def late_addition + 1234 + end + + def double_late_addition + 11 + end + + def double_late_addition + 22 + end +end + + +# Introduce some late methods (both module and direct) into the Object +# class. +class Object + include LateObject + def another_late_addition + 4321 + end +end + +# Introduce some late methods by inclusion. +module GlobalModule + def global_inclusion + 42 + end +end +include GlobalModule + +def direct_global + 43 +end + +###################################################################### +# Test case for blank slate. +# +class TestBlankSlate < Test::Unit::TestCase + def setup + @bs = BlankSlate.new + end + + def test_undefined_methods_remain_undefined + assert_raise(NoMethodError) { @bs.no_such_method } + assert_raise(NoMethodError) { @bs.nil? } + end + + + # NOTE: NameError is acceptable because the lack of a '.' means that + # Ruby can't tell if it is a method or a local variable. + def test_undefined_methods_remain_undefined_during_instance_eval + assert_raise(NoMethodError, NameError) do + @bs.instance_eval do nil? end + end + assert_raise(NoMethodError, NameError) do + @bs.instance_eval do no_such_method end + end + end + + def test_private_methods_are_undefined + assert_raise(NoMethodError) do + @bs.puts "HI" + end + end + + def test_targetted_private_methods_are_undefined_during_instance_eval + assert_raise(NoMethodError, NameError) do + @bs.instance_eval do self.puts "HI" end + end + end + + def test_untargetted_private_methods_are_defined_during_instance_eval + oldstdout = $stdout + $stdout = StringIO.new + @bs.instance_eval do + puts "HI" + end + ensure + $stdout = oldstdout + end + + def test_methods_added_late_to_kernel_remain_undefined + assert_equal 1234, nil.late_addition + assert_raise(NoMethodError) { @bs.late_addition } + end + + def test_methods_added_late_to_object_remain_undefined + assert_equal 4321, nil.another_late_addition + assert_raise(NoMethodError) { @bs.another_late_addition } + end + + def test_methods_added_late_to_global_remain_undefined + assert_equal 42, global_inclusion + assert_raise(NoMethodError) { @bs.global_inclusion } + end + + def test_preload_method_added + assert Kernel.k_added_names.include?(:late_addition) + assert Object.o_added_names.include?(:another_late_addition) + end + + def test_method_defined_late_multiple_times_remain_undefined + assert_equal 22, nil.double_late_addition + assert_raise(NoMethodError) { @bs.double_late_addition } + end + + def test_late_included_module_in_object_is_ok + assert_equal 33, 1.late_object + assert_raise(NoMethodError) { @bs.late_object } + end + + def test_late_included_module_in_kernel_is_ok + assert_raise(NoMethodError) { @bs.late_kernel } + end + + def test_revealing_previously_hidden_methods_are_callable + with_to_s = Class.new(BlankSlate) do + reveal :to_s + end + assert_match(/^#<.*>$/, with_to_s.new.to_s) + end + + def test_revealing_previously_hidden_methods_are_callable_with_block + Object.class_eval <<-EOS + def given_block(&block) + block + end + EOS + + with_given_block = Class.new(BlankSlate) do + reveal :given_block + end + assert_not_nil with_given_block.new.given_block {} + end + + def test_revealing_a_hidden_method_twice_is_ok + with_to_s = Class.new(BlankSlate) do + reveal :to_s + reveal :to_s + end + assert_match(/^#<.*>$/, with_to_s.new.to_s) + end + + def test_revealing_unknown_hidden_method_is_an_error + assert_raises(RuntimeError) do + Class.new(BlankSlate) do + reveal :xyz + end + end + end + + def test_global_includes_still_work + assert_nothing_raised do + assert_equal 42, global_inclusion + assert_equal 42, Object.new.global_inclusion + assert_equal 42, "magic number".global_inclusion + assert_equal 43, direct_global + end + end + + def test_reveal_should_not_bind_to_an_instance + with_object_id = Class.new(BlankSlate) do + reveal(:object_id) + end + + obj1 = with_object_id.new + obj2 = with_object_id.new + + assert obj1.object_id != obj2.object_id, + "Revealed methods should not be bound to a particular instance" + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_eventbuilder.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_eventbuilder.rb new file mode 100644 index 0000000..f434470 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_eventbuilder.rb @@ -0,0 +1,150 @@ +#!/usr/bin/env ruby + +#-- +# Portions copyright 2004 by Jim Weirich (jim@weirichhouse.org). +# Portions copyright 2005 by Sam Ruby (rubys@intertwingly.net). +# All rights reserved. + +# Permission is granted for use, copying, modification, distribution, +# and distribution of modified versions of this work as long as the +# above copyright notice is included. +#++ + +require 'test/unit' +require 'test/preload' +require 'builder' +require 'builder/xmlevents' + +class TestEvents < Test::Unit::TestCase + + class Target + attr_reader :events + + def initialize + @events = [] + end + + def start_tag(tag, attrs) + @events << [:start_tag, tag, attrs] + end + + def end_tag(tag) + @events << [:end_tag, tag] + end + + def text(string) + @events << [:text, string] + end + + end + + + def setup + @target = Target.new + @xml = Builder::XmlEvents.new(:target=>@target) + end + + def test_simple + @xml.one + expect [:start_tag, :one, nil] + expect [:end_tag, :one] + expect_done + end + + def test_nested + @xml.one { @xml.two } + expect [:start_tag, :one, nil] + expect [:start_tag, :two, nil] + expect [:end_tag, :two] + expect [:end_tag, :one] + expect_done + end + + def test_text + @xml.one("a") + expect [:start_tag, :one, nil] + expect [:text, "a"] + expect [:end_tag, :one] + expect_done + end + + def test_special_text + @xml.one("H&R") + expect [:start_tag, :one, nil] + expect [:text, "H&R"] + expect [:end_tag, :one] + expect_done + end + + def test_text_with_entity + @xml.one("H&R") + expect [:start_tag, :one, nil] + expect [:text, "H&R"] + expect [:end_tag, :one] + expect_done + end + + def test_attributes + @xml.a(:b=>"c", :x=>"y") + expect [:start_tag, :a, {:x => "y", :b => "c"}] + expect [:end_tag, :a] + expect_done + end + + def test_moderately_complex + @xml.tag! "address-book" do |x| + x.entry :id=>"1" do + x.name { + x.first "Bill" + x.last "Smith" + } + x.address "Cincinnati" + end + x.entry :id=>"2" do + x.name { + x.first "John" + x.last "Doe" + } + x.address "Columbus" + end + end + expect [:start_tag, "address-book".intern, nil] + expect [:start_tag, :entry, {:id => "1"}] + expect [:start_tag, :name, nil] + expect [:start_tag, :first, nil] + expect [:text, "Bill"] + expect [:end_tag, :first] + expect [:start_tag, :last, nil] + expect [:text, "Smith"] + expect [:end_tag, :last] + expect [:end_tag, :name] + expect [:start_tag, :address, nil] + expect [:text, "Cincinnati"] + expect [:end_tag, :address] + expect [:end_tag, :entry] + expect [:start_tag, :entry, {:id => "2"}] + expect [:start_tag, :name, nil] + expect [:start_tag, :first, nil] + expect [:text, "John"] + expect [:end_tag, :first] + expect [:start_tag, :last, nil] + expect [:text, "Doe"] + expect [:end_tag, :last] + expect [:end_tag, :name] + expect [:start_tag, :address, nil] + expect [:text, "Columbus"] + expect [:end_tag, :address] + expect [:end_tag, :entry] + expect [:end_tag, "address-book".intern] + expect_done + end + + def expect(value) + assert_equal value, @target.events.shift + end + + def expect_done + assert_nil @target.events.shift + end + +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_markupbuilder.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_markupbuilder.rb new file mode 100644 index 0000000..562b12a --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_markupbuilder.rb @@ -0,0 +1,611 @@ +#!/usr/bin/env ruby + +#-- +# Portions copyright 2004 by Jim Weirich (jim@weirichhouse.org). +# Portions copyright 2005 by Sam Ruby (rubys@intertwingly.net). +# All rights reserved. + +# Permission is granted for use, copying, modification, distribution, +# and distribution of modified versions of this work as long as the +# above copyright notice is included. +#++ + +require 'test/unit' +require 'test/preload' +require 'builder' +require 'builder/xmlmarkup' + +class TestMarkup < Test::Unit::TestCase + def setup + @xml = Builder::XmlMarkup.new + end + + def test_create + assert_not_nil @xml + end + + def test_simple + @xml.simple + assert_equal "", @xml.target! + end + + def test_value + @xml.value("hi") + assert_equal "hi", @xml.target! + end + + def test_empty_value + @xml.value("") + assert_equal "", @xml.target! + end + + def test_nil_value + @xml.value(nil) + assert_equal "", @xml.target! + end + + def test_no_value + @xml.value() + assert_equal "", @xml.target! + end + + def test_nested + @xml.outer { |x| x.inner("x") } + assert_equal "x", @xml.target! + end + + def test_attributes + @xml.ref(:id => 12) + assert_equal %{}, @xml.target! + end + + def test_single_quotes_for_attrs + @xml = Builder::XmlMarkup.new(:quote => :single) + @xml.ref(:id => 12) + assert_equal %{}, @xml.target! + end + + def test_mixed_quotes_for_attrs + @xml = Builder::XmlMarkup.new(:quote => :single) + x = Builder::XmlMarkup.new(:target=>@xml, :quote => :double) + @xml.ref(:id => 12) do + x.link(:id => 13) + end + assert_equal %{}, @xml.target! + end + + def test_string_attributes_are_escaped_by_default + @xml.ref(:id => "H&R") + assert_equal %{}, @xml.target! + end + + def test_symbol_attributes_are_unescaped_by_default + @xml.ref(:id => :"H&R") + assert_equal %{}, @xml.target! + end + + def test_attributes_escaping_can_be_turned_on + @xml = Builder::XmlMarkup.new + @xml.ref(:id => "") + assert_equal %{}, @xml.target! + end + + def test_mixed_attribute_escaping_with_nested_builders + x = Builder::XmlMarkup.new(:target=>@xml) + @xml.ref(:id=>:"H&R") { + x.element(:tag=>"Long&Short") + } + assert_equal "", + @xml.target! + end + + def test_multiple_attributes + @xml.ref(:id => 12, :name => "bill") + assert_match %r{^$}, @xml.target! + end + + def test_attributes_with_text + @xml.a("link", :href=>"http://onestepback.org") + assert_equal %{link}, @xml.target! + end + + def test_attributes_with_newlines + @xml.abbr("W3C", :title=>"World\nWide\rWeb\r\nConsortium") + assert_equal %{W3C}, + @xml.target! + end + + def test_complex + @xml.body(:bg=>"#ffffff") { |x| + x.title("T", :style=>"red") + } + assert_equal %{T}, @xml.target! + end + + def test_funky_symbol + @xml.tag!("non-ruby-token", :id=>1) { |x| x.ok } + assert_equal %{}, @xml.target! + end + + def test_tag_can_handle_private_method + @xml.tag!("loop", :id=>1) { |x| x.ok } + assert_equal %{}, @xml.target! + end + + def test_no_explicit_marker + @xml.p { |x| x.b("HI") } + assert_equal "

HI

", @xml.target! + end + + def test_reference_local_vars + n = 3 + @xml.ol { |x| n.times { x.li(n) } } + assert_equal "
  1. 3
  2. 3
  3. 3
", @xml.target! + end + + def test_reference_methods + @xml.title { |x| x.a { x.b(name) } } + assert_equal "<a><b>bob</b></a>", @xml.target! + end + + def test_append_text + @xml.p { |x| x.br; x.text! "HI" } + assert_equal "


HI

", @xml.target! + end + + def test_ambiguous_markup + ex = assert_raise(ArgumentError) { + @xml.h1("data1") { b } + } + assert_match(/\btext\b/, ex.message) + assert_match(/\bblock\b/, ex.message) + end + + def test_capitalized_method + @xml.P { |x| x.B("hi"); x.BR(); x.EM { x.text! "world" } } + assert_equal "

hi
world

", @xml.target! + end + + def test_escaping + @xml.div { |x| x.text! ""; x.em("H&R Block") } + assert_equal %{
<hi>H&R Block
}, @xml.target! + end + + def test_nil + b = Builder::XmlMarkup.new + b.tag! "foo", nil + assert_equal %{}, b.target! + end + + def test_nil_without_explicit_nil_handling + b = Builder::XmlMarkup.new(:explicit_nil_handling => false) + b.tag! "foo", nil + assert_equal %{}, b.target! + end + + def test_nil_with_explicit_nil_handling + b = Builder::XmlMarkup.new(:explicit_nil_handling => true) + b.tag! "foo", nil + assert_equal %{}, b.target! + end + + def test_non_escaping + @xml.div("ns:xml"=>:"&xml;") { |x| x << ""; x.em("H&R Block") } + assert_equal %{
H&R Block
}, @xml.target! + end + + def test_return_value + str = @xml.x("men") + assert_equal @xml.target!, str + end + + def test_stacked_builders + b = Builder::XmlMarkup.new( :target => @xml ) + b.div { @xml.span { @xml.a("text", :href=>"ref") } } + assert_equal "", @xml.target! + end + + def name + "bob" + end +end + +class TestAttributeEscaping < Test::Unit::TestCase + + def setup + @xml = Builder::XmlMarkup.new + end + + def test_element_gt + @xml.title('1<2') + assert_equal '1<2', @xml.target! + end + + def test_element_amp + @xml.title('AT&T') + assert_equal 'AT&T', @xml.target! + end + + def test_element_amp2 + @xml.title('&') + assert_equal '&amp;', @xml.target! + end + + def test_attr_less + @xml.a(:title => '2>1') + assert_equal '', @xml.target! + end + + def test_attr_amp + @xml.a(:title => 'AT&T') + assert_equal '', @xml.target! + end + + def test_attr_quot + @xml.a(:title => '"x"') + assert_equal '', @xml.target! + end + +end + +class TestNameSpaces < Test::Unit::TestCase + def setup + @xml = Builder::XmlMarkup.new(:indent=>2) + end + + def test_simple_name_spaces + @xml.rdf :RDF + assert_equal "\n", @xml.target! + end + + def test_long + xml = Builder::XmlMarkup.new(:indent=>2) + xml.instruct! + xml.rdf :RDF, + "xmlns:rdf" => :"&rdf;", + "xmlns:rdfs" => :"&rdfs;", + "xmlns:xsd" => :"&xsd;", + "xmlns:owl" => :"&owl;" do + xml.owl :Class, :'rdf:ID'=>'Bird' do + xml.rdfs :label, 'bird' + xml.rdfs :subClassOf do + xml.owl :Restriction do + xml.owl :onProperty, 'rdf:resource'=>'#wingspan' + xml.owl :maxCardinality,1,'rdf:datatype'=>'&xsd;nonNegativeInteger' + end + end + end + end + assert_match(/^<\?xml/, xml.target!) + assert_match(/\n/m, xml.target!) + end + + def test_ensure + xml = Builder::XmlMarkup.new + xml.html do + xml.body do + begin + xml.p do + raise Exception.new('boom') + end + rescue Exception => e + xml.pre e + end + end + end + assert_match %r{

}, xml.target! + assert_match %r{

}, xml.target! + end +end + +class TestDeclarations < Test::Unit::TestCase + def setup + @xml = Builder::XmlMarkup.new(:indent=>2) + end + + def test_declare + @xml.declare! :element + assert_equal "\n", @xml.target! + end + + def test_bare_arg + @xml.declare! :element, :arg + assert_equal"\n", @xml.target! + end + + def test_string_arg + @xml.declare! :element, "string" + assert_equal"\n", @xml.target! + end + + def test_mixed_args + @xml.declare! :element, :x, "y", :z, "-//OASIS//DTD DocBook XML//EN" + assert_equal "\n", @xml.target! + end + + def test_nested_declarations + @xml = Builder::XmlMarkup.new + @xml.declare! :DOCTYPE, :chapter do |x| + x.declare! :ELEMENT, :chapter, "(title,para+)".intern + end + assert_equal "]>", @xml.target! + end + + def test_nested_indented_declarations + @xml.declare! :DOCTYPE, :chapter do |x| + x.declare! :ELEMENT, :chapter, "(title,para+)".intern + end + assert_equal "\n]>\n", @xml.target! + end + + def test_complex_declaration + @xml.declare! :DOCTYPE, :chapter do |x| + x.declare! :ELEMENT, :chapter, "(title,para+)".intern + x.declare! :ELEMENT, :title, "(#PCDATA)".intern + x.declare! :ELEMENT, :para, "(#PCDATA)".intern + end + expected = %{ + + +]> +} + assert_equal expected, @xml.target! + end +end + + +class TestSpecialMarkup < Test::Unit::TestCase + def setup + @xml = Builder::XmlMarkup.new(:indent=>2) + end + + def test_comment + @xml.comment!("COMMENT") + assert_equal "\n", @xml.target! + end + + def test_indented_comment + @xml.p { @xml.comment! "OK" } + assert_equal "

\n \n

\n", @xml.target! + end + + def test_instruct + @xml.instruct! :abc, :version=>"0.9" + assert_equal "\n", @xml.target! + end + + def test_indented_instruct + @xml.p { @xml.instruct! :xml } + assert_match %r{

\n <\?xml version="1.0" encoding="UTF-8"\?>\n

\n}, + @xml.target! + end + + def test_instruct_without_attributes + @xml.instruct! :zz + assert_equal "\n", @xml.target! + end + + def test_xml_instruct + @xml.instruct! + assert_match(/^<\?xml version="1.0" encoding="UTF-8"\?>$/, @xml.target!) + end + + def test_xml_instruct_with_overrides + @xml.instruct! :xml, :encoding=>"UCS-2" + assert_match(/^<\?xml version="1.0" encoding="UCS-2"\?>$/, @xml.target!) + end + + def test_xml_instruct_with_standalong + @xml.instruct! :xml, :encoding=>"UCS-2", :standalone=>"yes" + assert_match(/^<\?xml version="1.0" encoding="UCS-2" standalone="yes"\?>$/, @xml.target!) + end + + def test_no_blocks + assert_raise(Builder::IllegalBlockError) do + @xml.instruct! { |x| x.hi } + end + assert_raise(Builder::IllegalBlockError) do + @xml.comment!(:element) { |x| x.hi } + end + end + + def test_cdata + @xml.cdata!("TEST") + assert_equal "\n", @xml.target! + end + + def test_cdata_with_ampersand + @xml.cdata!("TEST&CHECK") + assert_equal "\n", @xml.target! + end + + def test_cdata_with_included_close + @xml.cdata!("TEST]]>CHECK") + assert_equal "CHECK]]>\n", @xml.target! + end +end + +class TestIndentedXmlMarkup < Test::Unit::TestCase + def setup + @xml = Builder::XmlMarkup.new(:indent=>2) + end + + def test_one_level + @xml.ol { |x| x.li "text" } + assert_equal "
    \n
  1. text
  2. \n
\n", @xml.target! + end + + def test_two_levels + @xml.p { |x| + x.ol { x.li "text" } + x.br + } + assert_equal "

\n

    \n
  1. text
  2. \n
\n
\n

\n", @xml.target! + end + + def test_initial_level + @xml = Builder::XmlMarkup.new(:indent=>2, :margin=>4) + @xml.name { |x| x.first("Jim") } + assert_equal " \n Jim\n \n", @xml.target! + end + + class TestUtfMarkup < Test::Unit::TestCase + if ! String.method_defined?(:encode) + def setup + @old_kcode = $KCODE + end + + def teardown + $KCODE = @old_kcode + end + + def test_use_entities_if_no_encoding_is_given_and_kcode_is_none + $KCODE = 'NONE' + xml = Builder::XmlMarkup.new + xml.p("\xE2\x80\x99") + assert_match(%r(

), xml.target!) # + end + + def test_use_entities_if_encoding_is_utf_but_kcode_is_not + $KCODE = 'NONE' + xml = Builder::XmlMarkup.new + xml.instruct!(:xml, :encoding => 'UTF-8') + xml.p("\xE2\x80\x99") + assert_match(%r(

), xml.target!) # + end + else + # change in behavior. As there is no $KCODE anymore, the default + # moves from "does not understand utf-8" to "supports utf-8". + + def test_use_entities_if_no_encoding_is_given_and_kcode_is_none + xml = Builder::XmlMarkup.new + xml.p("\xE2\x80\x99") + assert_match("

\u2019

", xml.target!) # + end + + def test_use_entities_if_encoding_is_utf_but_kcode_is_not + xml = Builder::XmlMarkup.new + xml.instruct!(:xml, :encoding => 'UTF-8') + xml.p("\xE2\x80\x99") + assert_match("

\u2019

", xml.target!) # + end + end + + def encode string, encoding + if !String.method_defined?(:encode) + $KCODE = encoding + string + elsif encoding == 'UTF8' + string.force_encoding('UTF-8') + else + string + end + end + + def test_use_entities_if_kcode_is_utf_but_encoding_is_dummy_encoding + xml = Builder::XmlMarkup.new + xml.instruct!(:xml, :encoding => 'UTF-16') + xml.p(encode("\xE2\x80\x99", 'UTF8')) + assert_match(%r(

), xml.target!) # + end + + def test_use_entities_if_kcode_is_utf_but_encoding_is_unsupported_encoding + xml = Builder::XmlMarkup.new + xml.instruct!(:xml, :encoding => 'UCS-2') + xml.p(encode("\xE2\x80\x99", 'UTF8')) + assert_match(%r(

), xml.target!) # + end + + def test_use_utf8_if_encoding_defaults_and_kcode_is_utf8 + xml = Builder::XmlMarkup.new + xml.p(encode("\xE2\x80\x99",'UTF8')) + assert_equal encode("

\xE2\x80\x99

",'UTF8'), xml.target! + end + + def test_use_utf8_if_both_encoding_and_kcode_are_utf8 + xml = Builder::XmlMarkup.new + xml.instruct!(:xml, :encoding => 'UTF-8') + xml.p(encode("\xE2\x80\x99",'UTF8')) + assert_match encode("

\xE2\x80\x99

",'UTF8'), xml.target! + end + + def test_use_utf8_if_both_encoding_and_kcode_are_utf8_with_lowercase + xml = Builder::XmlMarkup.new + xml.instruct!(:xml, :encoding => 'utf-8') + xml.p(encode("\xE2\x80\x99",'UTF8')) + assert_match encode("

\xE2\x80\x99

",'UTF8'), xml.target! + end + end + + class TestXmlEvents < Test::Unit::TestCase + def setup + @handler = EventHandler.new + @xe = Builder::XmlEvents.new(:target=>@handler) + end + + def test_simple + @xe.p + assert_equal [:start, :p, nil], @handler.events.shift + assert_equal [:end, :p], @handler.events.shift + end + + def test_text + @xe.p("HI") + assert_equal [:start, :p, nil], @handler.events.shift + assert_equal [:text, "HI"], @handler.events.shift + assert_equal [:end, :p], @handler.events.shift + end + + def test_attributes + @xe.p("id"=>"2") + ev = @handler.events.shift + assert_equal [:start, :p], ev[0,2] + assert_equal "2", ev[2]['id'] + assert_equal [:end, :p], @handler.events.shift + end + + def test_indented + @xml = Builder::XmlEvents.new(:indent=>2, :target=>@handler) + @xml.p { |x| x.b("HI") } + assert_equal [:start, :p, nil], @handler.events.shift + assert_equal "\n ", pop_text + assert_equal [:start, :b, nil], @handler.events.shift + assert_equal "HI", pop_text + assert_equal [:end, :b], @handler.events.shift + assert_equal "\n", pop_text + assert_equal [:end, :p], @handler.events.shift + end + + def pop_text + result = '' + while ! @handler.events.empty? && @handler.events[0][0] == :text + result << @handler.events[0][1] + @handler.events.shift + end + result + end + + class EventHandler + attr_reader :events + def initialize + @events = [] + end + + def start_tag(sym, attrs) + @events << [:start, sym, attrs] + end + + def end_tag(sym) + @events << [:end, sym] + end + + def text(txt) + @events << [:text, txt] + end + end + end + +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_method_caching.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_method_caching.rb new file mode 100644 index 0000000..91f7aca --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_method_caching.rb @@ -0,0 +1,62 @@ +#!/usr/bin/env ruby + +#-- +# Portions copyright 2011 by Bart ten Brinke (info@retrosync.com). +# All rights reserved. + +# Permission is granted for use, copying, modification, distribution, +# and distribution of modified versions of this work as long as the +# above copyright notice is included. +#++ + +require 'test/unit' +require 'test/preload' +require 'builder' + +class TestMethodCaching < Test::Unit::TestCase + + # We can directly ask if xml object responds to the cache_me or + # do_not_cache_me methods because xml is derived from BasicObject + # (and repond_to? is not defined in BasicObject). + # + # Instead we are going to stub out method_missing so that it throws + # an error, and then make sure that error is either thrown or not + # thrown as appropriate. + + def teardown + super + Builder::XmlBase.cache_method_calls = true + end + + def test_caching_does_not_break_weird_symbols + xml = Builder::XmlMarkup.new + xml.__send__("work-order", 1) + assert_equal "1", xml.target! + end + + def test_method_call_caching + xml = Builder::XmlMarkup.new + xml.cache_me + + def xml.method_missing(*args) + ::Kernel.fail StandardError, "SHOULD NOT BE CALLED" + end + assert_nothing_raised do + xml.cache_me + end + end + + def test_method_call_caching_disabled + Builder::XmlBase.cache_method_calls = false + xml = Builder::XmlMarkup.new + xml.do_not_cache_me + + def xml.method_missing(*args) + ::Kernel.fail StandardError, "SHOULD BE CALLED" + end + assert_raise(StandardError, "SHOULD BE CALLED") do + xml.do_not_cache_me + end + end + +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_namecollision.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_namecollision.rb new file mode 100644 index 0000000..5b16b30 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_namecollision.rb @@ -0,0 +1,39 @@ +#!/usr/bin/env ruby + +#-- +# Portions copyright 2004 by Jim Weirich (jim@weirichhouse.org). +# Portions copyright 2005 by Sam Ruby (rubys@intertwingly.net). +# All rights reserved. + +# Permission is granted for use, copying, modification, distribution, +# and distribution of modified versions of this work as long as the +# above copyright notice is included. +#++ + +require 'test/unit' +require 'builder/xchar' + +class TestNameCollisions < Test::Unit::TestCase + module Collide + def xchr + end + end + + def test_no_collision + assert_nothing_raised do + Builder.check_for_name_collision(Collide, :not_defined) + end + end + + def test_collision + assert_raise RuntimeError do + Builder.check_for_name_collision(Collide, "xchr") + end + end + + def test_collision_with_symbol + assert_raise RuntimeError do + Builder.check_for_name_collision(Collide, :xchr) + end + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_xchar.rb b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_xchar.rb new file mode 100644 index 0000000..6a00716 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/gems/builder-3.2.2/test/test_xchar.rb @@ -0,0 +1,78 @@ +#!/usr/bin/env ruby +# encoding: us-ascii + +#-- +# Portions copyright 2004 by Jim Weirich (jim@weirichhouse.org). +# Portions copyright 2005 by Sam Ruby (rubys@intertwingly.net). +# All rights reserved. + +# Permission is granted for use, copying, modification, distribution, +# and distribution of modified versions of this work as long as the +# above copyright notice is included. +#++ + +#!/usr/bin/env ruby + +require 'test/unit' +require 'builder/xchar' + +if String.method_defined?(:encode) + class String + ENCODING_BINARY = Encoding.find('BINARY') + + # shim method for testing purposes + def to_xs(escape=true) + raise NameError.new('to_xs') unless caller[0].index(__FILE__) + + result = Builder::XChar.encode(self) + if escape + result.gsub(/[^\u0000-\u007F]/) {|c| "&##{c.ord};"} + else + # really only useful for testing purposes + result.force_encoding(ENCODING_BINARY) + end + end + end +end + +class TestXmlEscaping < Test::Unit::TestCase + REPLACEMENT_CHAR = Builder::XChar::REPLACEMENT_CHAR.to_xs + + def test_ascii + assert_equal 'abc', 'abc'.to_xs + end + + def test_predefined + assert_equal '&', '&'.to_xs # ampersand + assert_equal '<', '<'.to_xs # left angle bracket + assert_equal '>', '>'.to_xs # right angle bracket + end + + def test_invalid + assert_equal REPLACEMENT_CHAR, "\x00".to_xs # null + assert_equal REPLACEMENT_CHAR, "\x0C".to_xs # form feed + assert_equal REPLACEMENT_CHAR, "\xEF\xBF\xBF".to_xs # U+FFFF + end + + def test_iso_8859_1 + assert_equal 'ç', "\xE7".to_xs # small c cedilla + assert_equal '©', "\xA9".to_xs # copyright symbol + end + + def test_win_1252 + assert_equal '’', "\x92".to_xs # smart quote + assert_equal '€', "\x80".to_xs # euro + end + + def test_utf8 + assert_equal '’', "\xE2\x80\x99".to_xs # right single quote + assert_equal '©', "\xC2\xA9".to_xs # copy + end + + def test_utf8_verbatim + assert_equal "\xE2\x80\x99", "\xE2\x80\x99".to_xs(false) # right single quote + assert_equal "\xC2\xA9", "\xC2\xA9".to_xs(false) # copy + assert_equal "\xC2\xA9&\xC2\xA9", + "\xC2\xA9&\xC2\xA9".to_xs(false) # copy with ampersand + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/specifications/alphred-1.1.0.gemspec b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/specifications/alphred-1.1.0.gemspec new file mode 100644 index 0000000..6add217 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/specifications/alphred-1.1.0.gemspec @@ -0,0 +1,37 @@ +# -*- encoding: utf-8 -*- + +Gem::Specification.new do |s| + s.name = "alphred" + s.version = "1.1.0" + + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.authors = ["Alpha Chen"] + s.date = "2015-11-01" + s.email = ["alpha.chen@gmail.com"] + s.homepage = "https://github.com/kejadlen/alph" + s.licenses = ["MIT"] + s.require_paths = ["lib"] + s.rubygems_version = "2.0.14" + s.summary = "Helper utilities for making Alfred workflows." + + if s.respond_to? :specification_version then + s.specification_version = 4 + + if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then + s.add_runtime_dependency(%q, ["~> 3.2"]) + s.add_development_dependency(%q, ["~> 1.10"]) + s.add_development_dependency(%q, ["~> 10.0"]) + s.add_development_dependency(%q, [">= 0"]) + else + s.add_dependency(%q, ["~> 3.2"]) + s.add_dependency(%q, ["~> 1.10"]) + s.add_dependency(%q, ["~> 10.0"]) + s.add_dependency(%q, [">= 0"]) + end + else + s.add_dependency(%q, ["~> 3.2"]) + s.add_dependency(%q, ["~> 1.10"]) + s.add_dependency(%q, ["~> 10.0"]) + s.add_dependency(%q, [">= 0"]) + end +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/specifications/builder-3.2.2.gemspec b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/specifications/builder-3.2.2.gemspec new file mode 100644 index 0000000..5a2853d --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.A3870418-93FC-4377-BAF8-EE932B5CF901/vendor/bundle/ruby/2.0.0/specifications/builder-3.2.2.gemspec @@ -0,0 +1,20 @@ +# -*- encoding: utf-8 -*- + +Gem::Specification.new do |s| + s.name = "builder" + s.version = "3.2.2" + + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.authors = ["Jim Weirich"] + s.date = "2013-06-01" + s.description = "Builder provides a number of builder objects that make creating structured data\nsimple to do. Currently the following builder objects are supported:\n\n* XML Markup\n* XML Events\n" + s.email = "jim.weirich@gmail.com" + s.extra_rdoc_files = ["CHANGES", "MIT-LICENSE", "README.md", "Rakefile", "doc/releases/builder-1.2.4.rdoc", "doc/releases/builder-2.0.0.rdoc", "doc/releases/builder-2.1.1.rdoc"] + s.files = ["CHANGES", "MIT-LICENSE", "README.md", "Rakefile", "doc/releases/builder-1.2.4.rdoc", "doc/releases/builder-2.0.0.rdoc", "doc/releases/builder-2.1.1.rdoc"] + s.homepage = "http://onestepback.org" + s.licenses = ["MIT"] + s.rdoc_options = ["--title", "Builder -- Easy XML Building", "--main", "README.rdoc", "--line-numbers"] + s.require_paths = ["lib"] + s.rubygems_version = "2.0.14" + s.summary = "Builders for MarkUp." +end diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.EBB6171A-6C0B-447C-8BE5-E273C925A74F/info.plist b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.EBB6171A-6C0B-447C-8BE5-E273C925A74F/info.plist index dc51754..cc2f0ce 100644 --- a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.EBB6171A-6C0B-447C-8BE5-E273C925A74F/info.plist +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.EBB6171A-6C0B-447C-8BE5-E273C925A74F/info.plist @@ -9,16 +9,7 @@ connections 1FB4AA4F-276E-4B9E-B48B-D6119EE1B6AE - - - destinationuid - 43DCD79F-94B0-4F0D-B7C2-4F04DC7ECE20 - modifiers - 0 - modifiersubtext - - - + 2E57B3A5-B65F-4AB6-93B2-183BB082414B