<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.loadpath</filename>
    </added>
    <added>
      <filename>.project</filename>
    </added>
    <added>
      <filename>examples/i18n/.gitignore</filename>
    </added>
    <added>
      <filename>examples/i18n/README.textile</filename>
    </added>
    <added>
      <filename>examples/i18n/Rakefile</filename>
    </added>
    <added>
      <filename>examples/i18n/ar/addition.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/bg/addition.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/bg/consecutive_calculations.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/bg/division.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/cat/suma.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/da/summering.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/de/addition.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/de/division.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/en-lol/stuffing.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/en/addition.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/en/division.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/es/adicion.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/et/jagamine.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/et/liitmine.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/fi/jakolasku.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/fi/yhteenlasku.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/fr/addition.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/he/addition.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/he/division.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/hu/addition.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/hu/division.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/id/addition.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/id/division.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/it/somma.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/ja/addition.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/ja/division.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/ko/addition.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/ko/division.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/lt/addition.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/lt/division.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/lv/addition.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/lv/division.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/no/summering.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/pt/adicao.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/ro/suma.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/ru/addition.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/ru/consecutive_calculations.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/ru/division.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/se/summering.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/sk/addition.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/sk/division.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/zh-CN/addition.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/zh-TW/addition.feature</filename>
    </added>
    <added>
      <filename>examples/i18n/zh-TW/division.feature</filename>
    </added>
    <added>
      <filename>examples/self_test/.gitignore</filename>
    </added>
    <added>
      <filename>examples/self_test/features/features2cards.feature</filename>
    </added>
    <added>
      <filename>features/features2cards_cli.feature</filename>
    </added>
    <added>
      <filename>features/step_definitions/features2cards_steps.rb</filename>
    </added>
    <added>
      <filename>features/support/env.rb</filename>
    </added>
    <added>
      <filename>features2cards.gemspec</filename>
    </added>
    <added>
      <filename>geminstaller.yml</filename>
    </added>
    <added>
      <filename>lib/features2cards/platform.rb</filename>
    </added>
    <added>
      <filename>rake_tasks/features.rake</filename>
    </added>
    <added>
      <filename>rake_tasks/fix_cr_lf.rake</filename>
    </added>
    <added>
      <filename>rake_tasks/rspec.rake</filename>
    </added>
    <added>
      <filename>rake_tasks/rubygems.rake</filename>
    </added>
    <added>
      <filename>spec/features2cards/card_spec.rb</filename>
    </added>
    <added>
      <filename>spec/features2cards/cli_spec.rb</filename>
    </added>
    <added>
      <filename>spec/features2cards/prawn_spec.rb</filename>
    </added>
    <added>
      <filename>spec/spec.opts</filename>
    </added>
    <added>
      <filename>spec/spec_helper.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1 +1,2 @@
 pkg
+*.pdf</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,11 @@
-=== 1.0.0 / 2008-10-26
+=== 0.3.0.0 / 2009-05-28
+
+* Upgraded to Cucumber &gt; 0.3.x
+* Added language option to use the different languages cucumber supports.
+* Added out option to specify pdf file name.
+* Can handle directories and files
+
+=== 0.1.0 / 2008-10-26
 
 * 1 major enhancement
 </diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -9,11 +9,18 @@ off our sprints to create index cards for our task board.
 
 == Usage
 
-Example:
+  features2cards [options] [ [FILE|DIR] ]
 
-  features2cards features/scale.feature
-  
-This will generate a file called cards.pdf in the current directory.
+  Examples:
+    features2cards features2cards.feature
+    features2cards --out italian.pdf--language it examples/i18n/it
+
+=== Options
+
+  -l [LANG], --language [LANG]  Specify language for features (Default: en)
+  -o, --out [FILE]              Specify pdf output file (Default: cards.pdf).
+  --version                     Show version
+  -h, --help                    Show help
 
 == Install
 
@@ -23,7 +30,7 @@ This will generate a file called cards.pdf in the current directory.
 
 - Maintained by {Bryan Helmkamp}[mailto:bryan@brynary.com]
 - Inspired by Luke Melia (http://www.lukemelia.com/blog/archives/2007/12/29/pdf-storycards-001-released-my-first-gem)
-  
+
 == License
 
 Copyright (c) 2008 Bryan Helmkamp.</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -3,29 +3,5 @@ require &quot;rake/gempackagetask&quot;
 require &quot;rake/clean&quot;
 require './lib/features2cards.rb'
 
-spec = Gem::Specification.new do |s|
-  s.name         = &quot;features2cards&quot;
-  s.version      = Features2Cards::VERSION
-  s.author       = &quot;Bryan Helmkamp&quot;
-  s.email        = &quot;bryan&quot; + &quot;@&quot; + &quot;brynary.com&quot;
-  s.homepage     = &quot;http://github.com/brynary/features2cards&quot;
-  s.summary      = &quot;features2cards. Generate printable PDF index cards from Cucumber feature files&quot;
-  s.description  = s.summary
-  s.executables  = &quot;features2cards&quot;
-  s.files        = %w[History.txt MIT-LICENSE.txt README.rdoc Rakefile] + Dir[&quot;bin/*&quot;] + Dir[&quot;lib/**/*&quot;] + Dir[&quot;vendor/**/*&quot;]
-  
-  s.add_dependency &quot;prawn&quot;, &quot;&gt;= 0.1.2&quot;
-end
-
-Rake::GemPackageTask.new(spec) do |package|
-  package.gem_spec = spec
-end
-
-CLEAN.include [&quot;pkg&quot;, &quot;*.gem&quot;, &quot;doc&quot;, &quot;ri&quot;, &quot;coverage&quot;]
-
-desc 'Install the package as a gem.'
-task :install_gem =&gt; [:clean, :package] do
-  gem = Dir['pkg/*.gem'].first
-  sh &quot;sudo gem install --no-ri --no-rdoc --local #{gem}&quot;
-end
+Dir['rake_tasks/**/*.rake'].each { |rake| load rake }
 </diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -2,4 +2,4 @@
 
 require File.expand_path(File.dirname(__FILE__) + &quot;/../lib/features2cards&quot;)
 
-Features2Cards::CLI.execute
\ No newline at end of file
+Features2Cards::CLI.execute(ARGV.dup)
\ No newline at end of file</diff>
      <filename>bin/features2cards</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,21 @@
 require &quot;rubygems&quot;
 
-$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) unless $LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__)))
+unless $LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__)))
+  $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
+end
 
+require &quot;features2cards/platform&quot;
 require &quot;features2cards/cli&quot;
 
-module Features2Cards
-  VERSION = '0.1.1'
+module Features2Cards#:nodoc:
+  class VERSION #:nodoc:
+    MAJOR = 0
+    MINOR = 3
+    TINY  = 0
+    PATCH = 0 # Set to nil for official release
+
+    STRING = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
+    STABLE_STRING = [MAJOR, MINOR, TINY].join('.')
+  end
 end
+</diff>
      <filename>lib/features2cards.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,12 +5,38 @@ module Features2Cards
     attr_reader :body
     attr_reader :footer
 
-    def self.for_feature(feature)
-      new(&quot;Feature&quot;, feature.header.split(&quot;\n&quot;).first.gsub(/^\s*Feature:/, '').strip, &quot;&quot;)
-    end
-    
-    def self.for_scenario(scenario)
-      new(&quot;Scenario&quot;, scenario.name, scenario.feature.header.split(&quot;\n&quot;).first)
+    def self.for_feature(feature, lang)
+      actual_feature = feature.to_sexp()
+      actual_feature.shift
+      actual_feature.shift
+      title = actual_feature[0].split(&quot;\n&quot;).first
+      footer = title
+      body  = actual_feature[0].gsub(/^\s*#{title}\n/, '')
+      card = [new(title, body, &quot;&quot;)]
+      footer = title
+      
+      actual_feature.shift
+      scenarios = actual_feature
+      
+      scenarios.map do |scenario|
+        case(scenario[0])
+          when :scenario_outline
+            scenario.shift
+          when :scenario
+            scenario.shift
+            scenario.shift
+        end     
+         title = scenario[0] + &quot; &quot; + scenario[1]
+         scenario.shift
+         scenario.shift
+         body = &quot;&quot;
+         scenario.map do |step|
+           body += step[2] + &quot; &quot; + step[3] + &quot;\n&quot; if step[0] == :step or step[0] == :step_invocation 
+         end
+         card.push(new(title, body, footer))
+      end
+      
+      return card
     end
     
     def initialize(type, body, footer = nil)</diff>
      <filename>lib/features2cards/card.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,28 +1,29 @@
+require &quot;cucumber&quot;
 require &quot;features2cards/card&quot;
 require &quot;features2cards/prawn&quot;
 
 module Features2Cards
   class CLI
     
-    def self.execute
-      load_cucumber
-      new.execute
+    attr_reader :paths
+    attr_reader :options 
+      
+    def self.execute(args)
+      new(args).execute!
     end
-
-    def self.load_cucumber
-      $LOAD_PATH.unshift(File.expand_path(&quot;./vendor/plugins/cucumber/lib&quot;))
-  
-      require &quot;cucumber&quot;
-      require &quot;cucumber/treetop_parser/feature_en&quot;
-      Cucumber.load_language(&quot;en&quot;)
-  
-      Cucumber::Tree::Feature.class_eval do
-        attr_reader :scenarios
-      end
+    
+    def initialize(args, out_stream = STDOUT, error_stream = STDERR)
+      @args    = args  
+      @out_stream   = out_stream
+      @error_stream = error_stream
+      @paths   = []
+      @options = default_options      
     end
 
-    def execute
-      if files.empty?
+    def execute!    
+      parse!(@args)
+      load_cucumber(@options[:lang])
+      if feature_files.empty?
         usage
         exit
       end
@@ -30,40 +31,89 @@ module Features2Cards
       generate_pdf(cards)
     end
     
+    def parse!(args)
+      @args = args
+      @args.extend(::OptionParser::Arguable)      
+      @args.options  do |opts|
+        opts.banner = [&quot;Usage: features2cards [options] [ [FILE|DIR] ]+&quot;, &quot;&quot;,
+          &quot;Examples:&quot;,
+          &quot;features2cards features2cards.feature&quot;,
+          &quot;features2cards --language it examples/i18n/it&quot;,  
+        ].join(&quot;\n&quot;)
+        opts.on(&quot;-l [LANG]&quot;, &quot;--language [LANG]&quot;,
+          &quot;Specify language for features (Default: #{@options[:lang]})&quot;) do |v|         
+          @options[:lang] = v
+        end
+        opts.on(&quot;-o&quot;, &quot;--out [FILE]&quot;,
+          &quot;Specify pdf output file (Default: #{@options[:pdf_file]}).&quot;) do |v|
+          @options[:pdf_file] = v
+        end
+        opts.on_tail(&quot;--version&quot;, &quot;Show version.&quot;) do
+          @out_stream.puts VERSION::STRING
+          Kernel.exit
+        end
+        opts.on_tail(&quot;-h&quot;, &quot;--help&quot;, &quot;You're looking at it.&quot;) do
+          @out_stream.puts opts.help
+          Kernel.exit
+        end        
+    end.parse!
+
+      # Whatever is left after option parsing is the FILE arguments
+      @paths += args
+    end    
+    
+    def load_cucumber(lang)
+      Cucumber.load_language(lang)
+  
+      Cucumber::Ast::Feature.class_eval do
+        attr_reader :scenarios
+      end
+    end
+    
     def cards
       features_to_cards(features)
     end
     
     def features
-      files.map do |file|
-        parser.parse_feature(file)
+      feature_files.map do |file|
+        parser.parse_file(file, {})
       end
     end
     
-    def files
-      ARGV
+    def feature_files
+      potential_feature_files = @paths.map do |path|
+        path = path.gsub(/\\/, '/') # In case we're on windows. Globs don't work with backslashes.
+        path = path.chomp('/')
+        File.directory?(path) ? Dir[&quot;#{path}/**/*.feature&quot;] : path
+      end.flatten.uniq
+      potential_feature_files
     end
     
+    
     def parser
-      @parser ||= Cucumber::TreetopParser::FeatureParser.new
+      @parser ||= Cucumber::Parser::FeatureParser.new
     end
 
     def features_to_cards(features)
       features.map do |feature|
-        [Card.for_feature(feature)] +
-        feature.scenarios.map do |scenario|
-          Card.for_scenario(scenario)
-        end
+        [Card.for_feature(feature, @options[:lang])] 
       end.flatten
     end
 
     def generate_pdf(cards)
-      Prawn::Document.generate_cards(cards)
+      Prawn::Document.generate_cards(@options[:pdf_file], cards)
     end
     
     def usage
-      $stderr.puts &quot;ERROR: No feature files given&quot;
-      $stderr.puts &quot;usage: features2cards &lt;feature files&gt;&quot;
+      @error_stream.puts &quot;ERROR: No feature files given&quot;
+      @error_stream.puts &quot;Type 'features2cards --help' for usage.&quot;
+    end
+    
+    def default_options
+      {
+        :lang     =&gt; &quot;en&quot;,
+        :pdf_file =&gt; &quot;cards.pdf&quot;
+      }
     end
     
   end</diff>
      <filename>lib/features2cards/cli.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,8 +4,8 @@ class Prawn::Document
   CARD_WIDTH  = 72 * 5 # 5 inches
   CARD_HEIGHT = 72 * 3 # 3 inches
   
-  def self.generate_cards(cards)
-    generate(&quot;cards.pdf&quot;, :page_layout =&gt; :landscape) do
+  def self.generate_cards(outfile, cards)
+    generate(outfile, :page_layout =&gt; :landscape) do
       row = 2
       col = 0
   
@@ -44,16 +44,16 @@ class Prawn::Document
         
       outline_box
     
-      margin_box 18 do
-        text card.type + &quot;: &quot;, :size =&gt; 14
+      margin_box 8 do
+        text card.type, :size =&gt; 12
         
-        margin_box 36 do
-          text card.body, :size =&gt; 16, :align =&gt; :center
+        margin_box 16 do
+          text card.body, :size =&gt; 10, :align =&gt; :left
         end
         
         unless card.footer.nil?
-          bounding_box [bounds.left, bounds.bottom + 18], :width =&gt; bounds.width, :height =&gt; 18 do
-            text card.footer, :align =&gt; :right
+          bounding_box [bounds.left, bounds.bottom + 10], :width =&gt; bounds.width, :height =&gt; 10 do
+            text card.footer, :size =&gt; 8, :align =&gt; :right
           end
         end
       end</diff>
      <filename>lib/features2cards/prawn.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>examples/features2cards.feature</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>a47499eb5c6c1faebec92160e65aabc7eb34c179</id>
    </parent>
  </parents>
  <author>
    <name>Bryan Helmkamp</name>
    <email>bryan@brynary.com</email>
  </author>
  <url>http://github.com/brynary/features2cards/commit/179f36401c153d0117f697daf2d77d72e6e4e42e</url>
  <id>179f36401c153d0117f697daf2d77d72e6e4e42e</id>
  <committed-date>2009-06-12T13:10:58-07:00</committed-date>
  <authored-date>2009-06-12T13:10:58-07:00</authored-date>
  <message>Merge kosmas58/master

Conflicts:
	README.rdoc
	Rakefile
	features2cards.gemspec
	lib/features2cards.rb</message>
  <tree>910a73b4df3c37d98ce39514b62a3f950d61319b</tree>
  <committer>
    <name>Bryan Helmkamp</name>
    <email>bryan@brynary.com</email>
  </committer>
</commit>
