Skip to content

Commit

Permalink
Remove redsnow. Problem with windows version.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ladislav Prskavec committed Nov 28, 2014
1 parent 2a536de commit d50ad7e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 30 deletions.
1 change: 0 additions & 1 deletion apiary.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Gem::Specification.new do |gem|
gem.add_dependency "rack", ">= 1.4.0", "< 1.6.0"
gem.add_dependency "rake", "~> 10.3.2"
gem.add_dependency "thor", "~> 0.19.1"
gem.add_dependency "redsnow", "~> 0.3.2"

gem.add_runtime_dependency "json", "~> 1.8.1"

Expand Down
16 changes: 1 addition & 15 deletions lib/apiary/common.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# encoding: utf-8
require 'redsnow'

module Apiary
# Common function used in commands
Expand All @@ -10,24 +9,11 @@ class Common
def initialize()
end

def validate_blueprint(code)
result = RedSnow.parse(code)
if result.error[:code] == 0
@error_message = nil
return true
else
@error_message = result.error[:message]
puts "Blueprint validation error: #{@error_message}"
return false
end
end

def validate_apib_file(apib_file)
unless File.exist?(apib_file)
raise "Apiary definition file hasn't been found: #{apib_file.inspect}"
end
code = File.read(apib_file)
return validate_blueprint(code)
File.read(apib_file)
end

end
Expand Down
14 changes: 0 additions & 14 deletions spec/common_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,4 @@

end

describe 'Validate blueprint' do

it 'test validate blueprint' do
common = Apiary::Common.new
expect(common.validate_blueprint('# API_NAME')).to be_truthy
end

it 'test invalidate blueprint' do
common = Apiary::Common.new
expect(common.validate_blueprint("\t# API_NAME\t\r\n## Group Name")).to be_falsey
end

end

end

0 comments on commit d50ad7e

Please sign in to comment.