framework_identificator 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module FrameworkIdentificator
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  end
@@ -10,10 +10,11 @@ end
10
10
 
11
11
  module FrameworkIdentificator
12
12
  def self.from(source, type)
13
- raise ArgumentError unless source.class.name == "Pathname" || source.class.name == "Git::Base"
13
+ raise ArgumentError unless ["String", "Pathname", "Git::Base"].include?(source.class.name)
14
14
 
15
15
  # Use source itself if Pathname otherwise fetch the Git dir path
16
16
  source = source.class.name == "Git::Base" ? source.dir.path : source
17
+ raise ArgumentError if source == ""
17
18
 
18
19
  # Try to detect a Framework using the source
19
20
  case type
@@ -13,10 +13,21 @@ describe FrameworkIdentificator do
13
13
  context "with an empty string" do
14
14
  it "should raise an ArgumentError" do
15
15
  lambda {
16
- subject.from("")
16
+ subject.from("", :application)
17
17
  }.should raise_error(ArgumentError)
18
18
  end
19
19
  end
20
+ describe "with a String object" do
21
+ before { @source_string = File.join("projects", "my_rails_project") }
22
+ it "should not raise anything" do
23
+ lambda {
24
+ subject.from(@source_string, :application)
25
+ }.should_not raise_error
26
+ end
27
+ it "should return false" do
28
+ subject.from(@source_string, :application).should be_false
29
+ end
30
+ end
20
31
  describe "with a Pathname object" do
21
32
  before { @repository_path = Pathname.new(File.join("projects", "my_rails_project")) }
22
33
  describe "for a basic folders/files project" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: framework_identificator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-23 00:00:00.000000000 Z
12
+ date: 2012-12-24 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Identify the used framework of a given project.
15
15
  email:
@@ -57,7 +57,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
57
57
  version: '0'
58
58
  segments:
59
59
  - 0
60
- hash: -1570611119829215661
60
+ hash: -2322913756995590960
61
61
  required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  version: '0'
67
67
  segments:
68
68
  - 0
69
- hash: -1570611119829215661
69
+ hash: -2322913756995590960
70
70
  requirements: []
71
71
  rubyforge_project:
72
72
  rubygems_version: 1.8.24