jim 0.2.3 → 0.3.0.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -1 +1 @@
1
- <div class="test_partial">PARTIAL</div>
1
+ <div class="test_partial">PARTIAL</div>
@@ -1,12 +1,12 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title>Sammy Test Suite</title>
5
- <link rel="stylesheet" href="../vendor/qunit/qunit.css" type="text/css" media="screen">
6
- <script type="text/javascript" src="../vendor/qunit/qunit.js"></script>
7
- <script type="text/javascript" src="../vendor/jquery-1.4.1.js"></script>
4
+ <title>Sammy Test Suite</title>
5
+ <link rel="stylesheet" href="../vendor/qunit/qunit.css" type="text/css" media="screen">
6
+ <script type="text/javascript" src="../vendor/qunit/qunit.js"></script>
7
+ <script type="text/javascript" src="../vendor/jquery-1.4.1.js"></script>
8
8
  <script type="text/javascript" src="../vendor/qunit-spec.js"></script>
9
-
9
+
10
10
  <script type="text/javascript" src="../lib/sammy.js"></script>
11
11
  <script type="text/javascript" src="../lib/plugins/sammy.storage.js"></script>
12
12
  <script type="text/javascript" src="../lib/plugins/sammy.template.js"></script>
@@ -16,69 +16,69 @@
16
16
  <script type="text/javascript" src="../lib/plugins/sammy.haml.js"></script>
17
17
  </head>
18
18
  <body>
19
- <h1 id="qunit-header">Sammy Test Suite</h1>
20
- <h2 id="qunit-banner"></h2>
21
- <div id="qunit-testrunner-toolbar"></div>
22
- <h2 id="qunit-userAgent"></h2>
23
- <ol id="qunit-tests"></ol>
24
-
25
-
26
- <!-- Test HTML -->
19
+ <h1 id="qunit-header">Sammy Test Suite</h1>
20
+ <h2 id="qunit-banner"></h2>
21
+ <div id="qunit-testrunner-toolbar"></div>
22
+ <h2 id="qunit-userAgent"></h2>
23
+ <ol id="qunit-tests"></ol>
24
+
25
+
26
+ <!-- Test HTML -->
27
27
  <div id="main" style="display:none;">
28
28
  <div class="get_area"></div>
29
29
  <div id="test_area"></div>
30
30
  <form id="test_form" action="#/test" method="post">
31
31
  <input type="hidden" name="test_input" value="TEST" />
32
-
32
+
33
33
  <input type="checkbox" name="check[]" value="TEST 1" checked="checked" />
34
34
  <input type="checkbox" name="check[]" value="TEST 2" checked="checked" />
35
35
  </form>
36
36
  </div>
37
-
37
+
38
38
  <div id="form_params" style="display:none;">
39
39
  <form id="nested_params_test_form" action="#/test_nested_params" method="post">
40
40
  <input type="text" name="author" value="Wilde" />
41
41
  <input type="text" name="author" value="Thoreau" />
42
42
  <input type="text" name="title" value="Walden%21" />
43
-
43
+
44
44
  <input type="text" name="genre[]" value="documentary" />
45
45
  <input type="text" name="genre[]" value="nature" />
46
-
46
+
47
47
  <input type="text" name="woods[trees][][name]" value="Spruce" />
48
48
  <input type="text" name="woods[trees][][name]" value="Maple" />
49
-
49
+
50
50
  <input type="text" name="poll[name]" value="Which beverage do you like best?" />
51
51
  <input type="text" name="poll[priority]" value="10" />
52
52
  <input type="hidden" name="poll[options][1][id]" value="Ko5Pi" />
53
53
  <input type="text" name="poll[options][1][name]" value="Coffee" />
54
54
  <input type="hidden" name="poll[options][2][id]" value="Oaj5N" />
55
55
  <input type="text" name="poll[options][2][name]" value="Tea" />
56
-
56
+
57
57
  <input type="text" name="poll[options][1][ingredients][]" value="Water" />
58
58
  <input type="text" name="poll[options][1][ingredients][]" value="Coffein" />
59
59
  <input type="text" name="pages[][words][]" value="Woods" />
60
60
  <input type="text" name="pages[][words][]" value="Money" />
61
-
61
+
62
62
  <input type="text" name="music[instruments][][name]" value="Piano" />
63
63
  <input type="text" name="music[instruments][][size]" value="big" />
64
64
  <input type="text" name="music[instruments][][name]" value="Flute" />
65
- <input type="text" name="music[instruments][][size]" value="small" />
65
+ <input type="text" name="music[instruments][][size]" value="small" />
66
66
  </form>
67
-
67
+
68
68
  <form id="bad_nested_params_form" action="#/bad_nested_params" method="post">
69
69
  <!-- these produce bad request errors -->
70
70
  <input type="text" name="woods[trees][]name" value="Oak" />
71
71
  <input type="text" name="softdrinks[]" value="Pepsi" />
72
72
  <input type="text" name="softdrinks[name]" value="Cola" />
73
73
  <input type="text" name="beverages[wine]" value="Cuvee du Vatican" />
74
- <input type="text" name="beverages[wine][][name]" value="Fleurie" />
74
+ <input type="text" name="beverages[wine][][name]" value="Fleurie" />
75
75
  </form>
76
76
  </div>
77
-
77
+
78
78
  <script type="text/javascript" src="test_sammy_application.js"></script>
79
79
  <script type="text/javascript" src="test_sammy_event_context.js"></script>
80
80
  <script type="text/javascript" src="test_sammy_location_proxy.js"></script>
81
81
  <script type="text/javascript" src="test_sammy_plugins.js"></script>
82
- <script type="text/javascript" src="test_sammy_storage.js"></script>
82
+ <script type="text/javascript" src="test_sammy_storage.js"></script>
83
83
  </body>
84
- </html>
84
+ </html>
@@ -33,7 +33,7 @@
33
33
  equal(Sammy.apps['#main'], app);
34
34
  ok(app.extended);
35
35
  });
36
-
36
+
37
37
  context('Sammy.Application', 'init', {
38
38
  before: function() {
39
39
  var context = this;
@@ -70,7 +70,7 @@
70
70
  context.returned = this.route('get', /testing/, function() {
71
71
  $('#main').trigger('click');
72
72
  });
73
-
73
+
74
74
  this.mycallback = function() { this.redirect('#/'); };
75
75
 
76
76
  this.route('get', '/blah', function() {
@@ -80,7 +80,7 @@
80
80
  this.route('get', '/boosh/:boosh1/:boosh2', function() {
81
81
  $('#testarea').show();
82
82
  });
83
-
83
+
84
84
  this.get(/blurgh/, function() {
85
85
  alert('blurgh');
86
86
  });
@@ -88,13 +88,13 @@
88
88
  this.get('#/', function() {
89
89
  alert('home');
90
90
  });
91
-
91
+
92
92
  this.post('#/post', 'mycallback');
93
-
93
+
94
94
  this.route('#/verbless', function() {});
95
-
95
+
96
96
  this.route('any', '/any', function() {});
97
-
97
+
98
98
  });
99
99
  }
100
100
  })
@@ -157,7 +157,7 @@
157
157
  equal(route.path.toString(), new RegExp("^/any$").toString());
158
158
  });
159
159
  });
160
-
160
+
161
161
  context('Sammy.Application', 'mapRoutes', {
162
162
  before: function() {
163
163
  var context = this;
@@ -170,7 +170,7 @@
170
170
  ]
171
171
  context.app = new Sammy.Application(function() {
172
172
  this.empty = context.empty_callback;
173
-
173
+
174
174
  context.returned = this.mapRoutes(context.routes);
175
175
  });
176
176
  }
@@ -190,23 +190,23 @@
190
190
  equal(route.path, new RegExp("^#/string$").toString());
191
191
  equal(route.callback, this.empty_callback);
192
192
  });
193
-
193
+
194
194
  context('Sammy.Application', 'bind', {
195
195
  before: function() {
196
196
  var context = this;
197
197
  context.triggered = false;
198
198
  this.app = new Sammy.Application(function() {
199
-
199
+
200
200
  context.returned = this.bind('boosh', function() {
201
201
  context.triggered = 'boosh';
202
202
  context.inner_context = this;
203
203
  });
204
-
204
+
205
205
  this.bind('blurgh', function() {
206
206
  context.triggered = 'blurgh';
207
207
  context.inner_context = this;
208
208
  });
209
-
209
+
210
210
  });
211
211
  }
212
212
  })
@@ -261,7 +261,7 @@
261
261
  app.unload();
262
262
  }, this, 1, 3);
263
263
  });
264
-
264
+
265
265
  context('Sammy.Application','run', {
266
266
  before: function () {
267
267
  window.location.hash = ''
@@ -271,31 +271,31 @@
271
271
  this.app = new Sammy.Application(function() {
272
272
  this.element_selector = '#main';
273
273
  this.form_params = {};
274
-
274
+
275
275
  this.route('get', '#/', function() {
276
276
  $('.get_area').text('');
277
277
  });
278
-
278
+
279
279
  this.route('get', '#/test', function() {
280
280
  $('.get_area').text('test success');
281
281
  });
282
-
282
+
283
283
  this.route('post', '#/test', function() {
284
284
  this.app.form_was_run = 'YES';
285
285
  this.app.form_params = this.params;
286
286
  return false;
287
287
  });
288
-
288
+
289
289
  this.route('post', '#/live', function() {
290
290
  this.app.form_was_run = 'LIVE';
291
291
  this.app.form_params = this.params;
292
292
  return false;
293
293
  });
294
-
294
+
295
295
  this.route('get', '#/yield', function(c) {
296
296
  context.yielded_context = c;
297
297
  });
298
-
298
+
299
299
  this.bind('blurgh', function () {
300
300
  $('.get_area').text('event fired');
301
301
  });
@@ -378,7 +378,7 @@
378
378
  soon(function() { app.unload(); });
379
379
  });
380
380
  });
381
-
381
+
382
382
  context('Sammy.Application','lookupRoute', {
383
383
  before: function() {
384
384
  this.app = new Sammy.Application(function() {
@@ -417,7 +417,7 @@
417
417
  equal(route.verb, 'get');
418
418
  defined(route, 'callback');
419
419
  });
420
-
420
+
421
421
  context('Sammy.Application','runRoute', {
422
422
  before: function() {
423
423
  var context = this;
@@ -429,7 +429,7 @@
429
429
  this.route('get', '#/boosh/:test/:test2', function() {
430
430
  context.params = this.params;
431
431
  });
432
-
432
+
433
433
  this.route('get', '#/message/:message', function() {
434
434
  context.params = this.params;
435
435
  });
@@ -476,7 +476,7 @@
476
476
  app.runRoute('get','/blurgh');
477
477
  });
478
478
  });
479
-
479
+
480
480
  context('Sammy.Application','before', {
481
481
  before: function() {
482
482
  window.location.hash = '';
@@ -488,11 +488,11 @@
488
488
  this.params['belch'] = 'burp';
489
489
  context.before = this;
490
490
  });
491
-
491
+
492
492
  this.get('#/', function() {
493
493
  context.route = this;
494
494
  });
495
-
495
+
496
496
  this.get('#/boosh', function() {
497
497
  context.route = this;
498
498
  });
@@ -553,7 +553,7 @@
553
553
  }, 100);
554
554
  }, 200);
555
555
  })
556
-
556
+
557
557
  context('Sammy.Application','after', {
558
558
  before: function() {
559
559
  var context = this;
@@ -564,7 +564,7 @@
564
564
  this.params['belch'] = 'burp';
565
565
  context.after = this;
566
566
  });
567
-
567
+
568
568
  this.get('#/', function() {
569
569
  this.params['belch'] = 'boosh';
570
570
  context.route = this;
@@ -588,8 +588,8 @@
588
588
  deepEqual(context.route, context.after);
589
589
  context.app.unload();
590
590
  });
591
- });
592
-
591
+ });
592
+
593
593
  context('Sammy.Application', 'around', {
594
594
  before: function() {
595
595
  window.location.hash = '';
@@ -605,11 +605,11 @@
605
605
  }
606
606
  context.path.push('around1 out');
607
607
  });
608
-
608
+
609
609
  this.get('#/', function() {
610
610
  context.path.push('route ' + this.path);
611
611
  });
612
-
612
+
613
613
  });
614
614
  }
615
615
  })
@@ -654,24 +654,24 @@
654
654
  context.app.unload();
655
655
  });
656
656
  });
657
-
657
+
658
658
  context('Sammy.Application','helpers', {
659
659
  before: function() {
660
660
  var context = this;
661
661
  context.event_context = null;
662
662
  this.app = new Sammy.Application(function() {
663
-
663
+
664
664
  this.helpers({
665
665
  helpme: function() {
666
666
  return "halp!";
667
667
  }
668
668
  });
669
-
669
+
670
670
  this.get('#/', function() {
671
671
  this.params['belch'] = 'boosh';
672
672
  context.event_context = this;
673
673
  });
674
-
674
+
675
675
  this.bind('blurgh', function() {
676
676
  context.event_context = this;
677
677
  });
@@ -697,24 +697,24 @@
697
697
  this.app.unload();
698
698
  }, this, 2, 2);
699
699
  });
700
-
700
+
701
701
  context('Sammy.Application','helper', {
702
702
  before: function() {
703
703
  var context = this;
704
704
  context.event_context = null;
705
705
  this.app = new Sammy.Application(function() {
706
-
706
+
707
707
  this.helper(
708
708
  "helpme", function() {
709
709
  return "halp!";
710
710
  }
711
711
  );
712
-
712
+
713
713
  this.get('#/', function() {
714
714
  this.params['belch'] = 'boosh';
715
715
  context.event_context = this;
716
716
  });
717
-
717
+
718
718
  this.bind('blurgh', function() {
719
719
  context.event_context = this;
720
720
  });
@@ -740,10 +740,10 @@
740
740
  this.app.unload();
741
741
  }, this, 2, 2);
742
742
  });
743
-
743
+
744
744
  context('Sammy.Application', 'getLocation', {
745
745
  before: function() {
746
- this.app = new Sammy.Application;
746
+ this.app = new Sammy.Application;
747
747
  }
748
748
  })
749
749
  .should('return the browsers hash by default', function() {
@@ -752,10 +752,10 @@
752
752
  equal(this.app.getLocation(), "#/boosh");
753
753
  }, this);
754
754
  });
755
-
755
+
756
756
  context('Sammy.Application', 'setLocation', {
757
757
  before: function() {
758
- this.app = new Sammy.Application;
758
+ this.app = new Sammy.Application;
759
759
  }
760
760
  })
761
761
  .should('set the browsers hash by default', function() {
@@ -763,8 +763,8 @@
763
763
  soon(function() {
764
764
  equal(window.location.hash, '#/blurgh');
765
765
  })
766
- });
767
-
766
+ });
767
+
768
768
  context('Sammy.Application', 'post routes', {
769
769
  before: function() {
770
770
  var context = this;
@@ -772,18 +772,18 @@
772
772
  context.location = "";
773
773
  context.posted = false;
774
774
  this.app = new Sammy.Application(function() {
775
-
775
+
776
776
  this.get('#/blah', function() {
777
777
  context.location = "blah";
778
778
  context.visited.push('blah');
779
779
  this.redirect('#/boosh');
780
780
  });
781
-
781
+
782
782
  this.get('#/boosh', function() {
783
783
  context.location = "boosh";
784
784
  context.visited.push('boosh');
785
785
  });
786
-
786
+
787
787
  this.post(/test/, function() {
788
788
  context.location = "post";
789
789
  context.posted = true;
@@ -811,7 +811,7 @@
811
811
  }, 1000);
812
812
  }, 1000);
813
813
  });
814
-
814
+
815
815
  context('Sammy.Application', 'contextMatchesOptions', {
816
816
  before: function() {
817
817
  this.app = $.sammy();
@@ -866,7 +866,7 @@
866
866
  .should('match empty options', function() {
867
867
  ok(this.app.contextMatchesOptions(this.route, {}));
868
868
  });
869
-
869
+
870
870
  context('Sammy.Application', 'use', {
871
871
  before: function() {
872
872
  var context = this;
@@ -875,11 +875,11 @@
875
875
  this.a = a;
876
876
  app.b = b;
877
877
  this.c = c;
878
-
878
+
879
879
  this.isAuthenticated = function(username) {
880
880
  return true;
881
881
  }
882
-
882
+
883
883
  this.helpers({
884
884
  alert: function(message) {
885
885
  this.$element().append(message);
@@ -888,22 +888,22 @@
888
888
  return "MY USELESS PARTIAL";
889
889
  }
890
890
  });
891
-
891
+
892
892
  this.get('#/login', function(e) {
893
893
  e.alert(e.partial("Please Login"));
894
894
  });
895
895
  };
896
-
896
+
897
897
  this.app = new Sammy.Application(function() {
898
898
  this.use(TrivialLogin, 1, 2, 3);
899
899
  this.element_selector = '.get_area';
900
-
900
+
901
901
  this.get('#/', function() {
902
902
  this.alert('BOOSH');
903
903
  });
904
-
904
+
905
905
  });
906
-
906
+
907
907
  }
908
908
  })
909
909
  .should('raise error if the plugin is not defined', function() {
@@ -946,8 +946,8 @@
946
946
  equal(this.app.b, 2);
947
947
  equal(this.app.c, 3);
948
948
  });
949
-
950
-
949
+
950
+
951
951
  }
952
952
  // });
953
953
  })(jQuery);