diff --git a/LICENSE b/LICENSE index 963f4f3..e979de1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,22 +1,22 @@ -Copyright (c) 2012 Nick Quaranto - -MIT License - -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. \ No newline at end of file +Copyright (c) 2012, Nick Quaranto + +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/lib/motion/settings.rb b/lib/motion/settings.rb index b30711d..2e7b670 100644 --- a/lib/motion/settings.rb +++ b/lib/motion/settings.rb @@ -3,6 +3,9 @@ end require "fileutils" + +require "plist" + require "motion/settings/generator" require "motion/settings/version" diff --git a/lib/motion/settings/generator.rb b/lib/motion/settings/generator.rb index d67c7b0..168de8c 100644 --- a/lib/motion/settings/generator.rb +++ b/lib/motion/settings/generator.rb @@ -26,103 +26,13 @@ def generate plist_file_path = File.join(@root_path, "Root.plist") file plist_file_path do |file| - file.write <<-EOF - - - - - Title - Settings - StringsTable - Root - PreferenceSpecifiers - - - Type - PSTextFieldSpecifier - Title - Text Entry - Key - textEntry_key - DefaultValue - Simple Text - IsSecure - - KeyboardType - Alphabet - AutoCapitalizationType - Sentences - AutocorrectionType - Default - - - Title - Read Only - Key - readOnly_key - DefaultValue - Read Only Value - Type - PSTitleValueSpecifier - - - Type - PSToggleSwitchSpecifier - Title - Toogle - Key - toogle_key - DefaultValue - YES - TrueValue - YES - FalseValue - YES - - - Type - PSSliderSpecifier - Key - slider_key - DefaultValue - 1 - MinimumValue - 1 - MaximumValue - 100 - - - Type - PSGroupSpecifier - Title - Group2 - - - Type - PSMultiValueSpecifier - Title - Colors - Key - colors_key - DefaultValue - 1 - Values - - 1 - 2 - 3 - - Titles - - Blue - Red - Green - - - - - -EOF + file.write({ + "Title" => "Settings", + "StringsTable" => "Root", + "PreferenceSpecifiers" => [ + {"Title" => "Read Only", "Key" => "readonlykey", "DefaultValue" => "Read Only Duh", "Type" => "PSTitleValueSpecifier"} + ] + }.to_plist) end end diff --git a/motion-settings.gemspec b/motion-settings.gemspec index e479a6b..655a757 100644 --- a/motion-settings.gemspec +++ b/motion-settings.gemspec @@ -4,9 +4,9 @@ require File.expand_path('../lib/motion/settings/version', __FILE__) Gem::Specification.new do |gem| gem.authors = ["Nick Quaranto"] gem.email = ["nick@quaran.to"] - gem.description = %q{TODO: Write a gem description} - gem.summary = %q{TODO: Write a gem summary} - gem.homepage = "" + gem.summary = gem.description = + %{Create a Settings.bundle for your RubyMotion app. This allows your app to have a "global" settings entry in the Settings app.} + gem.homepage = "https://github.com/qrush/motion-settings" gem.files = `git ls-files`.split($\) gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } @@ -14,4 +14,7 @@ Gem::Specification.new do |gem| gem.name = "motion-settings" gem.require_paths = ["lib"] gem.version = Motion::Settings::VERSION + + gem.add_dependency 'plist', '~> 3.1.0' + gem.add_development_dependency 'rake' end