Permalink
Browse files

Cleanup, remove all old stuff

  • Loading branch information...
1 parent 81ec576 commit e83e3b63375436d270ec48b2ba0e50d23b937d3d @meeech committed Mar 29, 2012
Showing with 28 additions and 221 deletions.
  1. +0 −2 Classes/ComMeeechPlistModule.h
  2. +0 −31 Classes/ComMeeechPlistModule.m
  3. +7 −1 LICENSE
  4. +7 −147 README
  5. +10 −21 documentation/index.md
  6. +4 −19 example/app.js
@@ -11,6 +11,4 @@
}
-@property NSString *exampleProp;
-
@end
@@ -11,8 +11,6 @@
@implementation ComMeeechPlistModule
-@synthesize exampleProp;
-
#pragma mark Internal
// this is generated for your module, please do not change it
@@ -65,35 +63,8 @@ -(void)didReceiveMemoryWarning:(NSNotification*)notification
[super didReceiveMemoryWarning:notification];
}
-#pragma mark Listener Notifications
-
--(void)_listenerAdded:(NSString *)type count:(int)count
-{
- if (count == 1 && [type isEqualToString:@"my_event"])
- {
- // the first (of potentially many) listener is being added
- // for event named 'my_event'
- }
-}
-
--(void)_listenerRemoved:(NSString *)type count:(int)count
-{
- if (count == 0 && [type isEqualToString:@"my_event"])
- {
- // the last listener called for event named 'my_event' has
- // been removed, we can optionally clean up any resources
- // since no body is listening at this point for that event
- }
-}
-
#pragma Public APIs
--(id)example:(id)args
-{
- // example method
- return @"hello world";
-}
-
-(id)getValue:(id)args
{
NSString *key = [TiUtils stringValue:[args objectAtIndex:0]];
@@ -107,8 +78,6 @@ -(id)getValue:(id)args
// Another handy thing I had to search around for a little
// Get the value for the "Bundle version" from the Info.plist
return [mainBundle objectForInfoDictionaryKey:key];
-
-
}
@end
View
@@ -1 +1,7 @@
-Use at will.
+Copyright (c) 2012 Mitchell Amihod
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, publish, distribute, sublicense, 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.
View
154 README
@@ -1,151 +1,11 @@
-Appcelerator Titanium iPhone Module Project
-===========================================
+Plist Module
+============
-This is a skeleton Titanium Mobile iPhone module project. Modules can be
-used to extend the functionality of Titanium by providing additional native
-code that is compiled into your application at build time and can expose certain
-APIs into JavaScript.
+Simple module to access values from app plist at runtime.
-MODULE NAMING
---------------
+Example Usage:
-Choose a unique module id for your module. This ID usually follows a namespace
-convention using DNS notation. For example, com.appcelerator.module.test. This
-ID can only be used once by all public modules in Titanium.
+var plistmodule = require('com.meeech.plist'),
+ appVersion = plistmodule.getValue("CFBundleVersion");
-
-COMPONENTS
------------
-
-Components that are exposed by your module must follow a special naming convention.
-A component (widget, proxy, etc) must be named with the pattern:
-
- Ti<ModuleName><ComponentName>Proxy
-
-For example, if you component was called Foo, your proxy would be named:
-
- TiMyfirstFooProxy
-
-For view proxies or widgets, you must create both a view proxy and a view implementation.
-If you widget was named proxy, you would create the following files:
-
- TiMyfirstFooProxy.h
- TiMyfirstFooProxy.m
- TiMyfirstFoo.h
- TiMyfirstFoo.m
-
-The view implementation is named the same except it does contain the suffix `Proxy`.
-
-View implementations extend the Titanium base class `TiUIView`. View Proxies extend the
-Titanium base class `TiUIViewProxy` or `TiUIWidgetProxy`.
-
-For proxies that are simply native objects that can be returned to JavaScript, you can
-simply extend `TiProxy` and no view implementation is required.
-
-
-GET STARTED
-------------
-
-1. Edit manifest with the appropriate details about your module.
-2. Edit LICENSE to add your license details.
-3. Place any assets (such as PNG files) that are required in the assets folder.
-4. Edit the titanium.xcconfig and make sure you're building for the right Titanium version.
-5. Code and build.
-
-BUILD TIME COMPILER CONFIG
---------------------------
-
-You can edit the file `module.xcconfig` to include any build time settings that should be
-set during application compilation that your module requires. This file will automatically get `#include` in the main application project.
-
-For more information about this file, please see the Apple documentation at:
-
-<http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/400-Build_Configurations/build_configs.html>
-
-
-DOCUMENTATION FOR YOUR MODULE
------------------------------
-
-You should provide at least minimal documentation for your module in `documentation` folder using the Markdown syntax.
-
-For more information on the Markdown syntax, refer to this documentation at:
-
-<http://daringfireball.net/projects/markdown/>
-
-
-TEST HARNESS EXAMPLE FOR YOUR MODULE
-------------------------------------
-
-The `example` directory contains a skeleton application test harness that can be
-used for testing and providing an example of usage to the users of your module.
-
-
-INSTALL YOUR MODULE
---------------------
-
-1. Run `build.py` which creates your distribution
-2. cd to `/Library/Application Support/Titanium`
-3. copy this zip file into the folder of your Titanium SDK
-
-REGISTER YOUR MODULE
----------------------
-
-Register your module with your application by editing `tiapp.xml` and adding your module.
-Example:
-
-<modules>
- <module version="0.1">com.meeech.plist</module>
-</modules>
-
-When you run your project, the compiler will know automatically compile in your module
-dependencies and copy appropriate image assets into the application.
-
-USING YOUR MODULE IN CODE
--------------------------
-
-To use your module in code, you will need to require it.
-
-For example,
-
- var my_module = require('com.meeech.plist');
- my_module.foo();
-
-WRITING PURE JS NATIVE MODULES
-------------------------------
-
-You can write a pure JavaScript "natively compiled" module. This is nice if you
-want to distribute a JS module pre-compiled.
-
-To create a module, create a file named com.meeech.plist.js under the assets folder.
-This file must be in the Common JS format. For example:
-
- exports.echo = function(s)
- {
- return s;
- };
-
-Any functions and properties that are exported will be made available as part of your
-module. All other code inside your JS will be private to your module.
-
-For pure JS module, you don't need to modify any of the Objective-C module code. You
-can leave it as-is and build.
-
-TESTING YOUR MODULE
--------------------
-
-Run the `titanium.py` script to test your module or test from within XCode.
-To test with the script, execute:
-
- titanium run --dir=YOURMODULEDIR
-
-
-This will execute the app.js in the example folder as a Titanium application.
-
-
-DISTRIBUTING YOUR MODULE
--------------------------
-
-Currently, you will need to manually distribution your module distribution zip file directly. However, in the near future, we will make module distribution and sharing built-in to Titanium Developer and in the Titanium Marketplace!
-
-
-Cheers!
+Ti.API.info("CFBundleVersion => " + appVersion);
View
@@ -2,38 +2,27 @@
## Description
-TODO: Enter your module description here
+A module to allow reading of info.plist values at runtime.
## Accessing the plist-module Module
To access this module from JavaScript, you would do the following:
- var plist-module = require("com.meeech.plist");
-
-The plist-module variable is a reference to the Module object.
+`
+var plistmodule = require("com.meeech.plist");
+`
## Reference
-TODO: If your module has an API, you should document
-the reference here.
-
-### ___PROJECTNAMEASIDENTIFIER__.function
-
-TODO: This is an example of a module function.
-
-### ___PROJECTNAMEASIDENTIFIER__.property
-
-TODO: This is an example of a module property.
-
-## Usage
-
-TODO: Enter your usage example here
+`
+plistmodule.getValue('keyname');
+`
## Author
-TODO: Enter your author name, email and other contact
-details you want to share here.
+Mitchell Amihod
+twitter: [meeech](http://www.twitter.com/meeech)
## License
-TODO: Enter your license/legal information here.
+See LICENSE doc.
View
@@ -1,28 +1,13 @@
-// This is a test harness for your module
-// You should do something interesting in this harness
-// to test out the module and to provide instructions
-// to users on how to use it by example.
-
-
-// open a single window
var window = Ti.UI.createWindow({
backgroundColor:'white'
});
var label = Ti.UI.createLabel();
window.add(label);
window.open();
-// TODO: write your module tests here
-var plistmodule = require('com.meeech.plist');
-Ti.API.info("module is => " + plistmodule);
-
-label.text = plistmodule.example();
+var plistmodule = require('com.meeech.plist'),
+ appVersion = plistmodule.getValue("CFBundleVersion");
-plistmodule.exampleProp = "This is a test value";
-
-label.text = label.text + "\n" +plistmodule.exampleProp;
-label.text = label.text + "\n" +plistmodule.getValue("CFBundleVersion");
-
-// Ti.API.error("module exampleProp is => " + plistmodule.exampleProp);
-Ti.API.error("module version is => " + plistmodule.getValue("CFBundleVersion"));
+Ti.API.info("module is => " + plistmodule);
+label.text = "CFBundleVersion: " + appVersion;

0 comments on commit e83e3b6

Please sign in to comment.