{"id":18722834,"url":"https://github.com/qrush/motion-settings-bundle","last_synced_at":"2025-04-10T03:54:43.945Z","repository":{"id":4609019,"uuid":"5752450","full_name":"qrush/motion-settings-bundle","owner":"qrush","description":"Create a Settings.bundle for your RubyMotion app","archived":false,"fork":false,"pushed_at":"2019-05-18T11:33:14.000Z","size":1512,"stargazers_count":109,"open_issues_count":2,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-10T03:54:40.086Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qrush.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-10T16:39:35.000Z","updated_at":"2024-12-31T15:33:48.000Z","dependencies_parsed_at":"2022-09-13T19:14:41.449Z","dependency_job_id":null,"html_url":"https://github.com/qrush/motion-settings-bundle","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qrush%2Fmotion-settings-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qrush%2Fmotion-settings-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qrush%2Fmotion-settings-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qrush%2Fmotion-settings-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qrush","download_url":"https://codeload.github.com/qrush/motion-settings-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154999,"owners_count":21056542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T13:43:07.164Z","updated_at":"2025-04-10T03:54:43.925Z","avatar_url":"https://github.com/qrush.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# motion-settings-bundle\n\nCreate a Settings.bundle for your RubyMotion app. This allows your app to have a \"global\" settings entry in the Settings app.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'motion-settings-bundle'\n\nAnd then execute:\n\n    bundle\n\nOr install it yourself as:\n\n    gem install motion-settings-bundle\n\n## Usage\n\nAdd a chunk of code into your project's `Rakefile` like so:\n\n``` ruby\nrequire 'motion-settings-bundle'\n\nMotion::SettingsBundle.setup do |app|\n  # A text field. Allows configuration of a string.\n  app.text \"Name\", key: \"username\", default: \"Paul Atreides\"\n  app.text \"E-mail\", key: \"email\", keyboard: \"EmailAddress\", autocapitalization: \"None\"\n  app.text \"Password\", key: \"password\", secure: true\n\n  # A read-only text field. Use for showing a small chunk of text, maybe a version number\n  app.title \"Year of Birth\", key: \"yearOfBirth\", default: \"10,175 AG\"\n\n  # An on/off switch. Turn something on or off. Default is `false` (off).\n  app.toggle \"Kwisatz Haderach?\", key: \"superpowersEnabled\", default: true\n\n  # MultiValue, to choose from some item\n  app.multivalue \"Picture Resolution 1\", key: \"pictureResolution1\", default: \"1500\", values: [\"1500\", \"1200\", \"1000\"]\n\n  # MultiValue 2, with values and different titles (required when the values are numbers not string)\n  app.multivalue \"Picture Resolution 2\", key: \"pictureResolution2\", default: 1500, values: [1500, 1200, 1000],\n    titles: [\"1500px\", \"1200px\", \"1000px\"]\n\n  # A slider, configure volume or something linear\n  app.slider \"Spice Level\", key: \"spiceLevel\", default: 50, min: 1, max: 100\n\n  # Child pane to display licenses in\n  app.child \"Acknowledgements\" do |ack|\n    ack.child \"AwesomeOSSLibrary\" do |lic|\n      lic.group \"Copyright 2013 AwesomeOSSContributor\"\n      lic.group \"More license text that is terribly formatted but fulfills legal requirements\"\n    end\n  end\nend\n```\n\nNow just run `rake` as normal!\n\nThis should now add a `Settings.bundle` folder into your `resources` directory. Make sure to commit it! If you ever change the data in the `Settings.setup` block, it will be re-built on the next `rake` run. You'll end up with something like this:\n\n![screenshot1 of motion-settings-bundle](https://raw.github.com/qrush/motion-settings-bundle/master/screenshot1.png)\n![screenshot2 of motion-settings-bundle](https://raw.github.com/qrush/motion-settings-bundle/master/screenshot2.png)\n![screenshot3 of motion-settings-bundle](https://raw.github.com/qrush/motion-settings-bundle/master/screenshot3.png)\n\nIf you're wondering how to access this in code, it's pretty easy:\n\n``` ruby\nNSUserDefaults.standardUserDefaults[\"username\"]\n# returns \"Paul Atreides\"\n```\n\nAnd so on. Just remember, the defaults aren't populated until your user actually opens the Settings app, so make sure to handle all of your setting entries being `nil`.\n\n## TODO\n\nThis project really solely exists to avoid creating/editing the Settings.bundle in XCode. The specs for it so far have been based off [mordaroso/rubymotion-settings-bundle](https://github/mordaroso/rubymotion-settings-bundle). Please feel free to contribute more ways to generate settings!\n\n* Add a custom label, \"Settings for Blah\"\n* Don't re-create files every time\n* Slider default level doesn't seem to work yet\n\n## Contributing\n\nI couldn't figure out how to test this automatically. Run `bundle` to get the gems you need, and then `rake` to generate a RubyMotion app in the iOS simulator, and then open the Settings app.\n\nIf you've added a setting it would be really nice if you could update `screenshot.png` as well!\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## License\n\nMIT. See `LICENSE`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqrush%2Fmotion-settings-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqrush%2Fmotion-settings-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqrush%2Fmotion-settings-bundle/lists"}