jim 0.2.3 → 0.3.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/Gemfile +2 -1
  2. data/Gemfile.lock +2 -0
  3. data/HISTORY +13 -0
  4. data/README.md +148 -0
  5. data/Rakefile +6 -3
  6. data/bin/jim +1 -2
  7. data/default +0 -0
  8. data/jim.gemspec +142 -105
  9. data/lib/jim.rb +1 -1
  10. data/lib/jim/bundler.rb +168 -73
  11. data/lib/jim/cli.rb +200 -151
  12. data/lib/jim/index.rb +20 -9
  13. data/lib/jim/installer.rb +46 -46
  14. data/lib/jim/rack.rb +57 -20
  15. data/lib/jim/templates/jimfile +11 -5
  16. data/lib/jim/version_parser.rb +3 -3
  17. data/test/fixtures/infoincomments.js +1 -1
  18. data/test/fixtures/jimfile +14 -7
  19. data/test/fixtures/jquery-1.4.1.js +3 -6057
  20. data/test/fixtures/jquery.color.js +1 -1
  21. data/test/fixtures/localfile.js +1 -1
  22. data/test/fixtures/mustache.js/package.json +1 -1
  23. data/test/fixtures/noversion.js +1 -1
  24. data/test/fixtures/old_jimfile +7 -0
  25. data/test/fixtures/sammy-0.5.0/examples/backend/app.rb +4 -4
  26. data/test/fixtures/sammy-0.5.0/examples/backend/public/javascripts/app.js +18 -18
  27. data/test/fixtures/sammy-0.5.0/examples/backend/public/javascripts/jquery.cloudkit.js +1 -1
  28. data/test/fixtures/sammy-0.5.0/examples/backend/public/javascripts/jquery.js +1 -1
  29. data/test/fixtures/sammy-0.5.0/examples/backend/public/javascripts/sammy.js +161 -161
  30. data/test/fixtures/sammy-0.5.0/examples/backend/public/templates/task.html.erb +1 -1
  31. data/test/fixtures/sammy-0.5.0/examples/backend/public/templates/task_details.html.erb +1 -1
  32. data/test/fixtures/sammy-0.5.0/examples/backend/views/app.sass +6 -6
  33. data/test/fixtures/sammy-0.5.0/examples/backend/views/index.haml +5 -5
  34. data/test/fixtures/sammy-0.5.0/examples/form_handling/index.html +16 -16
  35. data/test/fixtures/sammy-0.5.0/examples/hello_world/index.html +13 -13
  36. data/test/fixtures/sammy-0.5.0/examples/location_override/data.html +28 -28
  37. data/test/fixtures/sammy-0.5.0/examples/location_override/index.html +18 -18
  38. data/test/fixtures/sammy-0.5.0/examples/location_override/test.html +36 -36
  39. data/test/fixtures/sammy-0.5.0/lib/min/sammy-0.5.0.min.js +1 -1
  40. data/test/fixtures/sammy-0.5.0/lib/min/sammy-lastest.min.js +1 -1
  41. data/test/fixtures/sammy-0.5.0/lib/plugins/sammy.cache.js +13 -13
  42. data/test/fixtures/sammy-0.5.0/lib/plugins/sammy.haml.js +2 -2
  43. data/test/fixtures/sammy-0.5.0/lib/plugins/sammy.json.js +15 -15
  44. data/test/fixtures/sammy-0.5.0/lib/plugins/sammy.mustache.js +46 -46
  45. data/test/fixtures/sammy-0.5.0/lib/plugins/sammy.nested_params.js +29 -29
  46. data/test/fixtures/sammy-0.5.0/lib/plugins/sammy.storage.js +54 -54
  47. data/test/fixtures/sammy-0.5.0/lib/plugins/sammy.template.js +17 -17
  48. data/test/fixtures/sammy-0.5.0/lib/sammy.js +220 -220
  49. data/test/fixtures/sammy-0.5.0/test/fixtures/partial.html +1 -1
  50. data/test/fixtures/sammy-0.5.0/test/index.html +26 -26
  51. data/test/fixtures/sammy-0.5.0/test/test_sammy_application.js +60 -60
  52. data/test/fixtures/sammy-0.5.0/test/test_sammy_event_context.js +21 -21
  53. data/test/fixtures/sammy-0.5.0/test/test_sammy_location_proxy.js +3 -3
  54. data/test/fixtures/sammy-0.5.0/test/test_sammy_plugins.js +17 -17
  55. data/test/fixtures/sammy-0.5.0/test/test_sammy_storage.js +4 -4
  56. data/test/helper.rb +15 -0
  57. data/test/test_jim_bundler.rb +114 -74
  58. data/test/test_jim_cli.rb +34 -18
  59. data/test/test_jim_index.rb +19 -19
  60. data/test/test_jim_installer.rb +13 -13
  61. data/test/test_jim_rack.rb +41 -0
  62. data/test/test_jim_version_parser.rb +4 -4
  63. metadata +204 -41
  64. data/.gitignore +0 -24
  65. data/README.rdoc +0 -105
  66. data/lib/jim/templates/commands +0 -58
data/.gitignore DELETED
@@ -1,24 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
- tmp
21
-
22
- ## PROJECT::SPECIFIC
23
- *.rbc
24
- .bundle
data/README.rdoc DELETED
@@ -1,105 +0,0 @@
1
- = jim
2
-
3
- jim is your friendly javascript library manager.
4
- He downloads, stores, bundles, vendors and compresses.
5
-
6
- == What is a jim?
7
-
8
- I'm frustrated with a lot of copy and pasting JS files from one directory to another and downloading new versions to who knows where and only really being able to use sprockets in Rails and lots of other small annoying things about the existing JS package/asset managers.
9
-
10
- Jim uses a lot of stolen ideas from a lot of great projects. Namely:
11
-
12
- * version management and flexible project fetching from rip
13
- * asset compression from jammit and sprockets
14
- * Gemfile and bundle from bundler
15
-
16
- The goals are simple:
17
-
18
- * Install a file, archive, git repo, etc from a local path or a URL into a common directory stored with a specific name and version number. Because should be able to install anything from anywhere, theres no need for a central package host.
19
- * Specify the local and installed files required for a project by name and version number in a single place. Dependencies for each project are not managed by the system, the onus is on you to specify them in the order you want them. _The project does not have to be in Ruby or even have a backend system._
20
- * Run a command to bundle all the required files into a single file.
21
- * Run a command to bundle the files _and_ run them through a JavaScript compressor.
22
-
23
- So far I've accomplished the goals, but this is all very very very beta and the API is sure to change and thing straight-up might not work.
24
-
25
- == Install
26
-
27
- jim is a rubygem:
28
-
29
- $ gem install jim
30
-
31
- You can also clone the source from github and use jeweler to install locally (requires jeweler):
32
-
33
- $ git clone git://github.com/quirkey/jim.git
34
- $ cd jim
35
- $ rake install
36
-
37
- == Usage
38
-
39
- From anywhere, install a project:
40
-
41
- // From a URL
42
- $ jim install http://code.jquery.com/jquery-1.4.2.js
43
- // From a zip (with name and version)
44
- $ jim install http://github.com/jquery/jquery-metadata/zipball/master jquery-metadata 2.0
45
-
46
- In your project run:
47
-
48
- $ jim init
49
-
50
- Which creates an empty "Jimfile". Open it up and add your requirements:
51
-
52
- // bundled_path: public/javascripts/bundled.js
53
- // compressed_path: public/javascripts/compressed.js
54
- // vendor_dir: public/javascripts/vendor
55
-
56
- jquery 1.4.2
57
- jquery-metadata 2.0
58
- // a local file, js/app.js (comments are fine)
59
- js/app
60
-
61
- If its a rack project, mount the Jim::Rack middleware which gives you live updates of your bundled and compressed js files:
62
-
63
- use Jim::Rack, :bundled_uri => '/javascripts/bundled-live.js',
64
- :compressed_uri => '/javascripts/compressed-live.js'
65
-
66
-
67
- Otherwise and also before deploys, etc, use the command line tool from your project's dir:
68
-
69
- $ jim bundle
70
- // or
71
- $ jim compress
72
-
73
- In order for compress to work, you need either the yui-compressor gem or the closure-compiler gem. Closure is the default, add
74
-
75
- Run `jim commands` for a full list of commands.
76
-
77
- == You're probably wondering
78
-
79
- ==== Why not implement it in JavaScript itself?
80
-
81
- CommonJS has certainly come a long way in a year, but in general the file system support and variety of libraries just isnt completely there yet for this type of project (IMHO). Also, I love Ruby and writing this was actually fun and pretty fast.
82
-
83
- With that said, I would gladly welcome anyone cloning the API in CommonJS (I'm just being lazy about it)
84
-
85
- ==== Does it work with __ library or __ development platform?
86
-
87
- Probably?? Its all very new at this point so please test it out and let me know.
88
-
89
- == Thanks
90
-
91
- Thanks to Yehuda Katz for talking through some of the ideas with me.
92
-
93
- == Note on Patches/Pull Requests
94
-
95
- * Fork the project.
96
- * Make your feature addition or bug fix.
97
- * Add tests for it. This is important so I don't break it in a
98
- future version unintentionally.
99
- * Commit, do not mess with rakefile, version, or history.
100
- (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
101
- * Send me a pull request. Bonus points for topic branches
102
-
103
- == Copyright
104
-
105
- Copyright (c) 2010 Aaron Quint. See LICENSE for details.
@@ -1,58 +0,0 @@
1
- init [path]
2
- Create an example Jimfile at path or the current directory if path is
3
- omitted
4
-
5
- install <url> [name] [version]
6
- Install the file(s) at url into the JIMHOME directory. URL can be any path
7
- or url that Downlow understands. This means:
8
-
9
- jim install http://code.jquery.com/jquery-1.4.1.js
10
- jim install ../sammy/
11
- jim install gh://quirkey/sammy
12
- jim install git://github.com/jquery/jquery.git
13
-
14
- remove <name> [version]
15
- uninstall <name> [version]
16
- Iterate through the install files and prompt for the removal of those
17
- matching the supplied name and version
18
-
19
- list [search]
20
- installed [search]
21
- List all the installed packages and their versions
22
-
23
- available [search]
24
- List all available projects and versions including those in the local path,
25
- or paths specified in a Jimfile
26
-
27
- resolve
28
- Resolve all the paths listed in a Jimfile and print them to STDOUT.
29
- If no Jimfile is set in the options, assumes ./Jimfile.
30
-
31
- bundle [bundled_path]
32
- Bundle all the files listed in a Jimfile and save them to [bundled_path].
33
- If the bundled_path is not set, jim will try to use the bundled_path set in
34
- the Jimfile. If no bundled_path is found - it will output the entire bundle
35
- to STDOUT.
36
- If no Jimfile is set in the options, assumes ./Jimfile.
37
-
38
- compress [compressed_path]
39
- Bundle all the files listed in a Jimfile, run through the google closure
40
- compiler and save them to [compressed_path].
41
- If the compressed_path is not set, jim will try to use the compressed_path
42
- set in the Jimfile. If no compressed_path is found - it will output the
43
- entire compressed bundle to STDOUT.
44
- If no Jimfile is set in the options, assumes ./Jimfile.
45
-
46
- vendor [vendor_dir]
47
- Copy all the files listed in Jimfile to the vendor_dir
48
-
49
- pack [vendor_dir]
50
- Runs in order, vendor, bundle, compress. This command simplifies the common
51
- workflow of vendoring and re-bundling before commiting or deploying changes
52
- to a project
53
-
54
- commands
55
- Print this help file
56
-
57
- cheat
58
- Print a quick list of commands without detailed description