From 5822000858a8d8baa3d50a04c13a5c6e2ed75d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mantas=20Norvai=C5=A1a?= Date: Sat, 16 May 2015 09:07:12 +0000 Subject: [PATCH] Version 0.2.0 --- Gemfile | 3 --- Gemfile.lock | 2 +- README.md | 16 ++++++++-------- spec/helpers_spec.rb | 6 +++--- to_lua.gemspec | 11 ++++++++--- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Gemfile b/Gemfile index 7d160ca..fa099aa 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,3 @@ source 'https://rubygems.org' # Specify your gem's dependencies in to_lua.gemspec gemspec - -gem 'rake' -gem 'rspec', '~> 3.2.0' diff --git a/Gemfile.lock b/Gemfile.lock index d69f1c5..4f231c3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - to_lua (0.1.1) + to_lua (0.2.0) GEM remote: https://rubygems.org/ diff --git a/README.md b/README.md index 4cc4d1f..21243ff 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Or install it manually with: ## Usage ```ruby -{a: 'hash'}.to_lua # {["a"]="hash"} +{a: 'hash'}.to_lua # {a="hash"} [:some, :array].to_lua # {"some","array"} "\nStr\"ing\x00".to_lua # "\nStr\"ing\0" 123456.to_lua # 123456 @@ -40,9 +40,9 @@ nil.to_lua # nil {a: 'hash', with: {a_nested: 'hash'}}.to_lua(pretty: true) # { -# ["a"] = "hash", -# ["with"] = { -# ["a_nested"] = "hash" +# a = "hash", +# with = { +# a_nested = "hash" # } # } @@ -54,9 +54,9 @@ nil.to_lua # nil {a: 'hash', with: {a_nested: 'hash'}}.to_lua(pretty: true, indent: '') # { -# ["a"] = "hash", -# ["with"] = { -# ["a_nested"] = "hash" +# a = "hash", +# with = { +# a_nested = "hash" # } # } ``` @@ -73,7 +73,7 @@ class CustomObject end end -CustomObject.new.to_lua # {["lua"]="object"} +CustomObject.new.to_lua # {lua="object"} ``` If an object does not define the `as_lua` method, `to_s` will be used instead diff --git a/spec/helpers_spec.rb b/spec/helpers_spec.rb index c256b51..ce9cdc9 100644 --- a/spec/helpers_spec.rb +++ b/spec/helpers_spec.rb @@ -59,21 +59,21 @@ it 'returns true if the identifier both has valid characters and is not a reserved keyword' do allow(ToLua::Helpers).to receive(:valid_identifier_characters?).and_return(true) allow(ToLua::Helpers).to receive(:reserved_keyword?).and_return(false) - + expect(ToLua::Helpers.valid_identifier?('test_identifier')).to be true end it 'returns false if the identifier has invalid characters' do allow(ToLua::Helpers).to receive(:valid_identifier_characters?).and_return(false) allow(ToLua::Helpers).to receive(:reserved_keyword?).and_return(false) - + expect(ToLua::Helpers.valid_identifier?('test_identifier')).to be false end it 'returns false if the identifier is a reserved keyword' do allow(ToLua::Helpers).to receive(:valid_identifier_characters?).and_return(true) allow(ToLua::Helpers).to receive(:reserved_keyword?).and_return(true) - + expect(ToLua::Helpers.valid_identifier?('test_identifier')).to be false end end diff --git a/to_lua.gemspec b/to_lua.gemspec index 3dcaceb..776cf71 100644 --- a/to_lua.gemspec +++ b/to_lua.gemspec @@ -3,13 +3,18 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) Gem::Specification.new do |s| s.name = 'to_lua' - s.version = '0.1.1' - s.date = '2015-05-14' - s.summary = 'Serialize objects to lua tables' + s.version = '0.2.0' + s.date = Date.today.to_s + s.summary = 'Serialize Ruby objects to lua tables' s.authors = ['Mantas NorvaiĊĦa'] s.email = 'mntnorv@gmail.com' s.homepage = 'https://github.com/mntnorv/to_lua' s.license = 'MIT' s.files = Dir['lib/**/*'] + + s.required_ruby_version = '>= 2.0.0' + + s.add_development_dependency('rake') + s.add_development_dependency('rspec', ['~> 3.2.0']) end