Skip to content

Commit

Permalink
Add license, generate a very, very simple plist
Browse files Browse the repository at this point in the history
  • Loading branch information
qrush committed Sep 10, 2012
1 parent 352c832 commit a941aa9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 122 deletions.
44 changes: 22 additions & 22 deletions LICENSE
@@ -1,22 +1,22 @@
Copyright (c) 2012 Nick Quaranto 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
Permission is hereby granted, free of charge, to any person obtaining files (the "Software"), to deal in the Software without
a copy of this software and associated documentation files (the restriction, including without limitation the rights to use,
"Software"), to deal in the Software without restriction, including copy, modify, merge, publish, distribute, sublicense, and/or sell
without limitation the rights to use, copy, modify, merge, publish, copies of the Software, and to permit persons to whom the
distribute, sublicense, and/or sell copies of the Software, and to Software is furnished to do so, subject to the following
permit persons to whom the Software is furnished to do so, subject to conditions:
the following conditions:

The above copyright notice and this permission notice shall be
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. OTHER DEALINGS IN THE SOFTWARE.
3 changes: 3 additions & 0 deletions lib/motion/settings.rb
Expand Up @@ -3,6 +3,9 @@
end end


require "fileutils" require "fileutils"

require "plist"

require "motion/settings/generator" require "motion/settings/generator"
require "motion/settings/version" require "motion/settings/version"


Expand Down
104 changes: 7 additions & 97 deletions lib/motion/settings/generator.rb
Expand Up @@ -26,103 +26,13 @@ def generate
plist_file_path = File.join(@root_path, "Root.plist") plist_file_path = File.join(@root_path, "Root.plist")


file plist_file_path do |file| file plist_file_path do |file|
file.write <<-EOF file.write({
<?xml version="1.0" encoding="UTF-8"?> "Title" => "Settings",
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> "StringsTable" => "Root",
<plist version="1.0"> "PreferenceSpecifiers" => [
<dict> {"Title" => "Read Only", "Key" => "readonlykey", "DefaultValue" => "Read Only Duh", "Type" => "PSTitleValueSpecifier"}
<key>Title</key> ]
<string>Settings</string> }.to_plist)
<key>StringsTable</key>
<string>Root</string>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
<key>Title</key>
<string>Text Entry</string>
<key>Key</key>
<string>textEntry_key</string>
<key>DefaultValue</key>
<string>Simple Text</string>
<key>IsSecure</key>
<false/>
<key>KeyboardType</key>
<string>Alphabet</string>
<key>AutoCapitalizationType</key>
<string>Sentences</string>
<key>AutocorrectionType</key>
<string>Default</string>
</dict>
<dict>
<key>Title</key>
<string>Read Only</string>
<key>Key</key>
<string>readOnly_key</string>
<key>DefaultValue</key>
<string>Read Only Value</string>
<key>Type</key>
<string>PSTitleValueSpecifier</string>
</dict>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Toogle</string>
<key>Key</key>
<string>toogle_key</string>
<key>DefaultValue</key>
<string>YES</string>
<key>TrueValue</key>
<string>YES</string>
<key>FalseValue</key>
<string>YES</string>
</dict>
<dict>
<key>Type</key>
<string>PSSliderSpecifier</string>
<key>Key</key>
<string>slider_key</string>
<key>DefaultValue</key>
<integer>1</integer>
<key>MinimumValue</key>
<integer>1</integer>
<key>MaximumValue</key>
<integer>100</integer>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>Title</key>
<string>Group2</string>
</dict>
<dict>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Title</key>
<string>Colors</string>
<key>Key</key>
<string>colors_key</string>
<key>DefaultValue</key>
<string>1</string>
<key>Values</key>
<array>
<string>1</string>
<string>2</string>
<string>3</string>
</array>
<key>Titles</key>
<array>
<string>Blue</string>
<string>Red</string>
<string>Green</string>
</array>
</dict>
</array>
</dict>
</plist>
EOF
end end
end end


Expand Down
9 changes: 6 additions & 3 deletions motion-settings.gemspec
Expand Up @@ -4,14 +4,17 @@ require File.expand_path('../lib/motion/settings/version', __FILE__)
Gem::Specification.new do |gem| Gem::Specification.new do |gem|
gem.authors = ["Nick Quaranto"] gem.authors = ["Nick Quaranto"]
gem.email = ["nick@quaran.to"] gem.email = ["nick@quaran.to"]
gem.description = %q{TODO: Write a gem description} gem.summary = gem.description =
gem.summary = %q{TODO: Write a gem summary} %{Create a Settings.bundle for your RubyMotion app. This allows your app to have a "global" settings entry in the Settings app.}
gem.homepage = "" gem.homepage = "https://github.com/qrush/motion-settings"


gem.files = `git ls-files`.split($\) gem.files = `git ls-files`.split($\)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.name = "motion-settings" gem.name = "motion-settings"
gem.require_paths = ["lib"] gem.require_paths = ["lib"]
gem.version = Motion::Settings::VERSION gem.version = Motion::Settings::VERSION

gem.add_dependency 'plist', '~> 3.1.0'
gem.add_development_dependency 'rake'
end end

0 comments on commit a941aa9

Please sign in to comment.