norbert-braid 0.4.9 → 0.4.12

Sign up to get free protection for your applications and to get access to all the features.
data/bin/braid CHANGED
@@ -51,9 +51,10 @@ Main {
51
51
  . braid add svn://remote/path --branch notmaster
52
52
  TXT
53
53
 
54
- mixin :argument_url, :option_type, :optional_path, :option_branch, :option_rails_plugin, :option_revision, :option_full
54
+ mixin :argument_url, :option_type, :optional_path, :option_branch, :option_rails_plugin, :option_revision, :option_full, :option_verbose
55
55
 
56
56
  run {
57
+ Braid::Operations::VERBOSE = verbose
57
58
  Braid::Command.run(:add, url, { "type" => type, "path" => path, "branch" => branch, "rails_plugin" => rails_plugin, "revision" => revision, "full" => full })
58
59
  }
59
60
  }
@@ -74,9 +75,10 @@ Main {
74
75
  . braid update local/dir
75
76
  TXT
76
77
 
77
- mixin :optional_path, :option_revision, :option_head, :option_safe
78
+ mixin :optional_path, :option_revision, :option_head, :option_safe, :option_verbose
78
79
 
79
80
  run {
81
+ Braid::Operations::VERBOSE = verbose
80
82
  Braid::Command.run(:update, path, { "revision" => revision, "head" => head , "safe" => safe })
81
83
  }
82
84
  }
@@ -94,9 +96,10 @@ Main {
94
96
  . braid remove local/dir
95
97
  TXT
96
98
 
97
- mixin :argument_path
99
+ mixin :argument_path, :option_verbose
98
100
 
99
101
  run {
102
+ Braid::Operations::VERBOSE = verbose
100
103
  Braid::Command.run(:remove, path)
101
104
  }
102
105
  }
@@ -110,9 +113,10 @@ Main {
110
113
  . braid setup local/dir
111
114
  TXT
112
115
 
113
- mixin :optional_path
116
+ mixin :optional_path, :option_verbose
114
117
 
115
118
  run {
119
+ Braid::Operations::VERBOSE = verbose
116
120
  Braid::Command.run(:setup, path)
117
121
  }
118
122
  }
@@ -126,9 +130,10 @@ Main {
126
130
  . braid diff local/dir
127
131
  TXT
128
132
 
129
- mixin :argument_path
133
+ mixin :argument_path, :option_verbose
130
134
 
131
135
  run {
136
+ Braid::Operations::VERBOSE = verbose
132
137
  Braid::Command.run(:diff, path)
133
138
  }
134
139
  }
@@ -218,6 +223,14 @@ Main {
218
223
  attr
219
224
  }
220
225
  }
226
+
227
+ mixin(:option_verbose) {
228
+ option(:verbose, :v) {
229
+ optional
230
+ desc 'log shell commands'
231
+ attr
232
+ }
233
+ }
221
234
 
222
235
  run { help! }
223
236
  }
data/braid.gemspec CHANGED
@@ -1,18 +1,18 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{braid}
3
- s.version = "0.4.9"
3
+ s.version = "0.4.12"
4
4
 
5
5
  s.specification_version = 2 if s.respond_to? :specification_version=
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Cristi Balan", "Norbert Crombach"]
9
- s.date = %q{2008-09-06}
9
+ s.date = %q{2008-10-04}
10
10
  s.default_executable = %q{braid}
11
11
  s.description = %q{A simple tool for tracking vendor branches in git.}
12
12
  s.email = %q{evil@che.lu}
13
13
  s.executables = ["braid"]
14
14
  s.extra_rdoc_files = ["README.rdoc"]
15
- s.files = ["LICENSE", "README.rdoc", "Rakefile", "braid.gemspec", "bin/braid", "lib/braid/command.rb", "lib/braid/commands/add.rb", "lib/braid/commands/diff.rb", "lib/braid/commands/remove.rb", "lib/braid/commands/setup.rb", "lib/braid/commands/update.rb", "lib/braid/config.rb", "lib/braid/mirror.rb", "lib/braid/operations.rb", "lib/braid.rb", "test/braid_test.rb", "test/config_test.rb", "test/mirror_test.rb", "test/operations_test.rb", "test/test_helper.rb"]
15
+ s.files = ["bin/braid", "braid.gemspec", "lib/braid/command.rb", "lib/braid/commands/add.rb", "lib/braid/commands/diff.rb", "lib/braid/commands/remove.rb", "lib/braid/commands/setup.rb", "lib/braid/commands/update.rb", "lib/braid/config.rb", "lib/braid/mirror.rb", "lib/braid/operations.rb", "lib/braid.rb", "LICENSE", "Rakefile", "README.rdoc", "test/braid_test.rb", "test/config_test.rb", "test/fixtures/shiny/README", "test/fixtures/skit1/layouts/layout.liquid", "test/fixtures/skit1/preview.png", "test/fixtures/skit1.1/layouts/layout.liquid", "test/fixtures/skit1.2/layouts/layout.liquid", "test/integration/adding_test.rb", "test/integration/updating_test.rb", "test/integration_helper.rb", "test/mirror_test.rb", "test/operations_test.rb", "test/test_helper.rb"]
16
16
  s.has_rdoc = true
17
17
  s.homepage = %q{http://evil.che.lu/projects/braid}
18
18
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "braid", "--main", "README.rdoc"]
@@ -23,7 +23,7 @@ module Braid
23
23
 
24
24
  msg "Setting up remote for '#{mirror.path}/'."
25
25
  unless mirror.type == "svn"
26
- git.remote_add(mirror.remote, mirror.url, mirror.branch)
26
+ git.remote_add(mirror.remote, mirror.cached_url, mirror.branch)
27
27
  else
28
28
  git_svn.init(mirror.remote, mirror.url)
29
29
  end
data/lib/braid/mirror.rb CHANGED
@@ -29,7 +29,7 @@ module Braid
29
29
  end
30
30
 
31
31
  def self.new_from_options(url, options = {})
32
- url.sub!(/\/$/, '')
32
+ url = url.sub(/\/$/, '')
33
33
 
34
34
  branch = options["branch"] || "master"
35
35
 
@@ -91,12 +91,25 @@ module Braid
91
91
 
92
92
  def fetch
93
93
  unless type == "svn"
94
+ init_or_fetch_local_cache
94
95
  git.fetch(remote)
95
96
  else
96
97
  git_svn.fetch(remote)
97
98
  end
98
99
  end
99
100
 
101
+ def cached_url
102
+ if Braid::USE_LOCAL_CACHE
103
+ File.join(Braid::LOCAL_CACHE_DIR, url.gsub(/[\/:@]/, "_"))
104
+ else
105
+ url
106
+ end
107
+ end
108
+
109
+ def init_or_fetch_local_cache
110
+ git_cache.init_or_fetch(url, cached_url)
111
+ end
112
+
100
113
  private
101
114
  def method_missing(name, *args)
102
115
  if ATTRIBUTES.find { |attribute| name.to_s =~ /^(#{attribute})(=)?$/ }
@@ -14,13 +14,14 @@ module Braid
14
14
  end
15
15
  end
16
16
  class VersionTooLow < BraidError
17
- def initialize(command, version)
17
+ def initialize(command, version, required)
18
18
  @command = command
19
19
  @version = version.to_s.split("\n").first
20
+ @required = required
20
21
  end
21
22
 
22
23
  def message
23
- "#{@command} version too low: #{@version}"
24
+ "#{@command} version too low: #{@version}. #{@required} needed."
24
25
  end
25
26
  end
26
27
  class UnknownRevision < BraidError
@@ -33,12 +34,22 @@ module Braid
33
34
  "local changes are present"
34
35
  end
35
36
  end
37
+ class LocalCacheDirBroken < BraidError
38
+ def initialize(dir)
39
+ @dir = dir
40
+ end
41
+
42
+ def message
43
+ "Local cache '#{@dir}' needs to be recreated. Remove the directory and run the command again."
44
+ end
45
+ end
36
46
 
37
47
  # The command proxy is meant to encapsulate commands such as git, git-svn and svn, that work with subcommands.
38
48
  class Proxy
39
49
  include Singleton
40
50
 
41
51
  def self.command; name.split('::').last.downcase; end # hax!
52
+ def self.verbose; Braid::Operations::VERBOSE ; end
42
53
 
43
54
  def version
44
55
  status, out, err = exec!("#{self.class.command} --version")
@@ -68,7 +79,7 @@ module Braid
68
79
  end
69
80
 
70
81
  def require_version!(required)
71
- require_version(required) || raise(VersionTooLow.new(self.class.command, version))
82
+ require_version(required) || raise(VersionTooLow.new(self.class.command, version, required))
72
83
  end
73
84
 
74
85
  private
@@ -92,6 +103,7 @@ module Braid
92
103
  ENV['LANG'] = 'C'
93
104
 
94
105
  out, err = nil
106
+ puts "executing cmd(#{cmd})" if Proxy.verbose
95
107
  status = Open4.popen4(cmd) do |pid, stdin, stdout, stderr|
96
108
  out = stdout.read
97
109
  err = stderr.read
@@ -107,6 +119,11 @@ module Braid
107
119
  raise ShellExecutionError, err unless status == 0
108
120
  [status, out, err]
109
121
  end
122
+
123
+ def msg(str)
124
+ puts str
125
+ end
126
+
110
127
  end
111
128
 
112
129
  class Git < Proxy
@@ -124,7 +141,7 @@ module Braid
124
141
 
125
142
  def fetch(remote)
126
143
  # open4 messes with the pipes of index-pack
127
- system("git fetch -n #{remote} &> /dev/null")
144
+ system("git fetch -n #{remote} 2>&1 >/dev/null")
128
145
  raise ShellExecutionError, "could not fetch" unless $? == 0
129
146
  true
130
147
  end
@@ -249,7 +266,7 @@ module Braid
249
266
 
250
267
  def fetch(remote)
251
268
  # open4 messes with the pipes of index-pack
252
- system("git svn fetch #{remote} &> /dev/null")
269
+ system("git svn fetch #{remote} 2>&1 >/dev/null")
253
270
  raise ShellExecutionError, "could not fetch" unless $? == 0
254
271
  true
255
272
  end
@@ -278,6 +295,27 @@ module Braid
278
295
  end
279
296
  end
280
297
 
298
+ class GitCache < Proxy
299
+ def init_or_fetch(url, dir)
300
+ if File.exists? dir
301
+ # bail if the local cache was created with --no-checkout
302
+ if File.exists? "#{dir}/.git"
303
+ raise LocalCacheDirBroken.new(dir)
304
+ end
305
+
306
+ msg "Updating local cache of '#{url}' into '#{dir}'."
307
+ FileUtils.cd(dir) do |d|
308
+ status, out, err = exec!("git fetch")
309
+ end
310
+ else
311
+ FileUtils.mkdir_p(Braid::LOCAL_CACHE_DIR)
312
+
313
+ msg "Caching '#{url}' into '#{dir}'."
314
+ status, out, err = exec!("git clone --mirror #{url} #{dir}")
315
+ end
316
+ end
317
+ end
318
+
281
319
  module VersionControl
282
320
  def git
283
321
  Git.instance
@@ -290,6 +328,10 @@ module Braid
290
328
  def svn
291
329
  Svn.instance
292
330
  end
331
+
332
+ def git_cache
333
+ GitCache.instance
334
+ end
293
335
  end
294
336
  end
295
337
  end
data/lib/braid.rb CHANGED
@@ -1,10 +1,12 @@
1
1
  $:.unshift File.dirname(__FILE__)
2
2
 
3
3
  module Braid
4
- VERSION = "0.4.9"
4
+ VERSION = "0.4.12"
5
5
 
6
6
  CONFIG_FILE = ".braids"
7
- REQUIRED_GIT_VERSION = "1.5.4.5"
7
+ USE_LOCAL_CACHE = ENV["BRAID_USE_LOCAL_CACHE"] != "no"
8
+ LOCAL_CACHE_DIR = ENV["BRAID_LOCAL_CACHE_DIR"] || "#{ENV["HOME"]}/.braid/cache/"
9
+ REQUIRED_GIT_VERSION = "1.6"
8
10
 
9
11
  class BraidError < StandardError
10
12
  def message
@@ -0,0 +1,3 @@
1
+ shiny app
2
+
3
+ it uses braid to pull in a bunch of stuff!
@@ -0,0 +1,219 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ {{ '/feed/atom.xml' | assign_to: 'global_feed' }}
4
+ {{ '/feed/all_comments.xml' | assign_to: 'global_comments_feed' }}
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <title>
8
+ {{ site.title }}
9
+ {% if site.current_section %}
10
+ - {{ site.current_section.name }}
11
+ {% endif %}
12
+ {% if article %}
13
+ - {{ article.title }}
14
+ {% endif %}
15
+ </title>
16
+ <link rel="alternate" type="application/atom+xml" title="{{ site.title }} feed" href="{{ global_feed }}"/>
17
+ <link rel="alternate" type="application/atom+xml" title="{{ site.title }} comments feed" href="{{ global_comments_feed }}"/>
18
+ {{ 'base' | stylesheet }}
19
+ {{ 'app' | javascript }}
20
+ <!--[if IE]>
21
+ {{ 'base_ie' | stylesheet }}
22
+ <![endif]-->
23
+ </head>
24
+
25
+ <body class="fixed orange">
26
+ <script type="text/javascript">loadPreferences()</script>
27
+
28
+ <div id="wrapper">
29
+
30
+ <div id="header" class="clearfix">
31
+ <div id="title" class="clearfix">
32
+ <h1><a href="/">{{ site.title }}</a></h1>
33
+ </div>
34
+ <h2>Sections</h2>
35
+ <ul id="menu">
36
+ {% for section in site.sections %}
37
+ {% if section.articles_count > 0 %}
38
+ {% if section.is_home %}
39
+ <li{% if section.current %} class="selected"{% endif %}>{{ section | link_to_section }}</li>
40
+ {% else %}
41
+ {% if section.is_paged %}
42
+ <li{% if section.current %} class="selected"{% endif %}>{{ section | link_to_section }}</li>
43
+ {% endif %}
44
+ {% endif %}
45
+ {% endif %}
46
+ {% endfor %}
47
+ </ul>
48
+ </div>
49
+
50
+ <div id="contentwrapper" class="clearfix">
51
+
52
+ <div id="content">
53
+
54
+ <div id="innerwrapper">
55
+
56
+ <div class="article">
57
+ <div class="body">
58
+ <h2>Skittlish Tips'n'Tricks</h2>
59
+ <ul>
60
+ <li>Change the classes for the body tag to set your default site style. also change these in the app.js file (line 66).</li>
61
+ <li>Remove the scripts and the #options div if you don't want the option switcher.</li>
62
+ <li>The top menu shows the home section and the sections that are not blogs.</li>
63
+ <li>Email me at <a href="mailto:evil@che.lu">evil@che.lu</a> if you have any questions.</li>
64
+ <li>Happy hacking!</li>
65
+ </ul>
66
+ </div>
67
+ </div>
68
+
69
+ {{ content_for_layout }}
70
+
71
+ </div>
72
+
73
+ </div>
74
+
75
+ <div id="sidebar">
76
+
77
+ <div class="boxy short">
78
+ <h3>boxy short</h3>
79
+
80
+ <p>You can have, boxes with a short, tall or no background shade, just change the class of the containing div.</p>
81
+
82
+ <p>Have boxes with smaller text with the class "minor". See the "Recent" boxy below.</p>
83
+
84
+ </div>
85
+
86
+ <div id="search" class="boxy short">
87
+ <h3>Search</h3>
88
+ <form method="get" action="/search">
89
+ <fieldset>
90
+ <input class="text" type="text" id="q" value="" name="q"/>
91
+ </fieldset>
92
+ </form>
93
+ </div>
94
+
95
+ <div class="boxy tall minor">
96
+ <h3>Recent</h3>
97
+
98
+ <dl>
99
+ <dt>Articles <a class="feed" href="{{ global_feed }}"><span>feed</span></a></dt>
100
+ <dd>
101
+ <ul>
102
+ {% for article in site.latest_articles %}
103
+ <li>{{ article | link_to_article }} <em>({{ article.published_at | format_date: 'stub', true }})</em></li>
104
+ {% endfor %}
105
+ </ul>
106
+ </dd>
107
+
108
+ <dt>Comments <a class="feed" href="{{ global_comments_feed }}"><span>feed</span></a></dt>
109
+ <dd>
110
+ <ul>
111
+ {% for comment in site.latest_comments %}
112
+ <li>{{ comment.author_link }} on <a href="{{ comment.url }}#comment-{{ comment.id }}">{{ comment.title }}</a></li>
113
+ {% endfor %}
114
+ </ul>
115
+ </dd>
116
+ </dl>
117
+ </div>
118
+
119
+ <div class="boxy short">
120
+ <h3>Archives</h3>
121
+ <p>This would be much nicer with jamis' month_drop thingy.</p>
122
+ {{ '' | section | months | assign_to: 'home_section' }}
123
+ <ul>
124
+ {% for month in home_section.months %}
125
+ {{ home_section | monthly_articles: month | size | assign_to: 'articles_count' }}
126
+ {% if articles_count > 0 %}
127
+ <li>{{ home_section | link_to_month: month }} ({{ articles_count }})</li>
128
+ {% endif %}
129
+ {% endfor %}
130
+ </ul>
131
+ </div>
132
+
133
+ {% if site.blog_sections.size > 1 %}
134
+ <div class="boxy short">
135
+ <h3>Categories</h3>
136
+ <p>Lists only blog type categories with at least one article.</p>
137
+ <p>This list uses an ul. You could use a dl with only dd's in it for the same effect. Wouldn't be semantic tho.</p>
138
+ <ul class="sections">
139
+ {% for section in site.blog_sections %}
140
+ {% if section.articles_count > 0 %}
141
+ {% unless section.is_home %}
142
+ <li>{{ section | link_to_section }} ({{ section.articles_count }})</li>
143
+ {% endunless %}
144
+ {% endif %}
145
+ {% endfor %}
146
+ </ul>
147
+ </div>
148
+
149
+ {% endif %}
150
+ {% unless site.tags == empty %}
151
+ <div class="boxy short">
152
+ <p>This would be nicer if we could get the number of articles for each tag.</p>
153
+ <h3>tags: </h3>
154
+ <ul>
155
+ {% for tag in site.tags %}
156
+ <li>{{ tag | link_to_tag }}</li>
157
+ {% endfor %}
158
+ </ul>
159
+ </div>
160
+
161
+ {% endunless %}
162
+ <div class="boxy tall">
163
+ <h3>boxy tall</h3>
164
+ <p>When using a tall box, make sure it's got plenty of content or that it's immediately followed by a short boxy. It might look a bit chopped off otherwise.</p>
165
+ <dl>
166
+ <dt>thing 1</dt>
167
+ <dd><a href="#">value 1</a></dd>
168
+ <dd><a href="#">value 2</a></dd>
169
+ <dd><a href="#">value 3</a></dd>
170
+ <dd><a href="#">value 4</a></dd>
171
+ <dd><a href="#">value 5</a></dd>
172
+ <dd><a href="#">value 6</a></dd>
173
+ <dd><a href="#">value 6</a></dd>
174
+
175
+ <dt>thing 1</dt>
176
+ <dd><a href="#">value 1</a></dd>
177
+ <dd><a href="#">value 2</a></dd>
178
+ <dd><a href="#">value 3</a></dd>
179
+ <dd>value 4</dd>
180
+ <dd>value 5</dd>
181
+ <dd><a href="#">value 6</a></dd>
182
+ <dd><a href="#">value 6</a></dd>
183
+
184
+ </dl>
185
+ </div>
186
+
187
+ </div>
188
+
189
+ </div>
190
+
191
+ <div id="options">
192
+ <h2>Options:</h2>
193
+ <h3>Size</h3>
194
+ <ul id="option_size">
195
+ <li id="option_size_fixed" class="fixed" ><a><span>fixed </span></a></li>
196
+ <li id="option_size_fluid" class="fluid" ><a><span>fluid </span></a></li>
197
+ </ul>
198
+ <h3>Colors</h3>
199
+ <ul id="option_color">
200
+ <li id="option_color_orange" class="orange"><a><span>orange</span></a></li>
201
+ <li id="option_color_blue" class="blue" ><a><span>blue </span></a></li>
202
+ <li id="option_color_green" class="green" ><a><span>green </span></a></li>
203
+ <li id="option_color_pink" class="pink" ><a><span>pink </span></a></li>
204
+ <li id="option_color_cyan" class="cyan" ><a><span>cyan </span></a></li>
205
+ <li id="option_color_red" class="red" ><a><span>red </span></a></li>
206
+ <li id="option_color_violet" class="violet"><a><span>violet</span></a></li>
207
+ </ul>
208
+ </div>
209
+
210
+ <div id="footer">
211
+ <p>Copyright &copy; 2006, Your Name. Valid <a href="http://validator.w3.org/check/referer">XHTML</a> and <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>.</p>
212
+ <p>Using <a href="http://evil.che.lu/projects/skittlish">skittlish</a> on <a href="http://publishwithimpunity.com/">mephisto</a>.</p>
213
+ </div>
214
+
215
+ </div>
216
+
217
+ </body>
218
+
219
+ </html>
Binary file
@@ -0,0 +1,219 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ {{ '/feed/atom.xml' | assign_to: 'global_feed' }}
4
+ {{ '/feed/all_comments.xml' | assign_to: 'global_comments_feed' }}
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <title>
8
+ {{ site.title }}
9
+ {% if site.current_section %}
10
+ - {{ site.current_section.name }}
11
+ {% endif %}
12
+ {% if article %}
13
+ - {{ article.title }}
14
+ {% endif %}
15
+ </title>
16
+ <link rel="alternate" type="application/atom+xml" title="{{ site.title }} feed" href="{{ global_feed }}"/>
17
+ <link rel="alternate" type="application/atom+xml" title="{{ site.title }} comments feed" href="{{ global_comments_feed }}"/>
18
+ {{ 'base' | stylesheet }}
19
+ {{ 'app' | javascript }}
20
+ <!--[if IE]>
21
+ {{ 'base_ie' | stylesheet }}
22
+ <![endif]-->
23
+ </head>
24
+
25
+ <body class="fixed green">
26
+ <script type="text/javascript">loadPreferences()</script>
27
+
28
+ <div id="wrapper">
29
+
30
+ <div id="header" class="clearfix">
31
+ <div id="title" class="clearfix">
32
+ <h1><a href="/">{{ site.title }}</a></h1>
33
+ </div>
34
+ <h2>Sections</h2>
35
+ <ul id="menu">
36
+ {% for section in site.sections %}
37
+ {% if section.articles_count > 0 %}
38
+ {% if section.is_home %}
39
+ <li{% if section.current %} class="selected"{% endif %}>{{ section | link_to_section }}</li>
40
+ {% else %}
41
+ {% if section.is_paged %}
42
+ <li{% if section.current %} class="selected"{% endif %}>{{ section | link_to_section }}</li>
43
+ {% endif %}
44
+ {% endif %}
45
+ {% endif %}
46
+ {% endfor %}
47
+ </ul>
48
+ </div>
49
+
50
+ <div id="contentwrapper" class="clearfix">
51
+
52
+ <div id="content">
53
+
54
+ <div id="innerwrapper">
55
+
56
+ <div class="article">
57
+ <div class="body">
58
+ <h2>Skittlish Tips'n'Tricks</h2>
59
+ <ul>
60
+ <li>Change the classes for the body tag to set your default site style. also change these in the app.js file (line 66).</li>
61
+ <li>Remove the scripts and the #options div if you don't want the option switcher.</li>
62
+ <li>The top menu shows the home section and the sections that are not blogs.</li>
63
+ <li>Email me at <a href="mailto:evil@che.lu">evil@che.lu</a> if you have any questions.</li>
64
+ <li>Happy hacking!</li>
65
+ </ul>
66
+ </div>
67
+ </div>
68
+
69
+ {{ content_for_layout }}
70
+
71
+ </div>
72
+
73
+ </div>
74
+
75
+ <div id="sidebar">
76
+
77
+ <div class="boxy short">
78
+ <h3>boxy short</h3>
79
+
80
+ <p>You can have, boxes with a short, tall or no background shade, just change the class of the containing div.</p>
81
+
82
+ <p>Have boxes with smaller text with the class "minor". See the "Recent" boxy below.</p>
83
+
84
+ </div>
85
+
86
+ <div id="search" class="boxy short">
87
+ <h3>Search</h3>
88
+ <form method="get" action="/search">
89
+ <fieldset>
90
+ <input class="text" type="text" id="q" value="" name="q"/>
91
+ </fieldset>
92
+ </form>
93
+ </div>
94
+
95
+ <div class="boxy tall minor">
96
+ <h3>Recent</h3>
97
+
98
+ <dl>
99
+ <dt>Articles <a class="feed" href="{{ global_feed }}"><span>feed</span></a></dt>
100
+ <dd>
101
+ <ul>
102
+ {% for article in site.latest_articles %}
103
+ <li>{{ article | link_to_article }} <em>({{ article.published_at | format_date: 'stub', true }})</em></li>
104
+ {% endfor %}
105
+ </ul>
106
+ </dd>
107
+
108
+ <dt>Comments <a class="feed" href="{{ global_comments_feed }}"><span>feed</span></a></dt>
109
+ <dd>
110
+ <ul>
111
+ {% for comment in site.latest_comments %}
112
+ <li>{{ comment.author_link }} on <a href="{{ comment.url }}#comment-{{ comment.id }}">{{ comment.title }}</a></li>
113
+ {% endfor %}
114
+ </ul>
115
+ </dd>
116
+ </dl>
117
+ </div>
118
+
119
+ <div class="boxy short">
120
+ <h3>Archives</h3>
121
+ <p>This would be much nicer with jamis' month_drop thingy.</p>
122
+ {{ '' | section | months | assign_to: 'home_section' }}
123
+ <ul>
124
+ {% for month in home_section.months %}
125
+ {{ home_section | monthly_articles: month | size | assign_to: 'articles_count' }}
126
+ {% if articles_count > 0 %}
127
+ <li>{{ home_section | link_to_month: month }} ({{ articles_count }})</li>
128
+ {% endif %}
129
+ {% endfor %}
130
+ </ul>
131
+ </div>
132
+
133
+ {% if site.blog_sections.size > 1 %}
134
+ <div class="boxy short">
135
+ <h3>Categories</h3>
136
+ <p>Lists only blog type categories with at least one article.</p>
137
+ <p>This list uses an ul. You could use a dl with only dd's in it for the same effect. Wouldn't be semantic tho.</p>
138
+ <ul class="sections">
139
+ {% for section in site.blog_sections %}
140
+ {% if section.articles_count > 0 %}
141
+ {% unless section.is_home %}
142
+ <li>{{ section | link_to_section }} ({{ section.articles_count }})</li>
143
+ {% endunless %}
144
+ {% endif %}
145
+ {% endfor %}
146
+ </ul>
147
+ </div>
148
+
149
+ {% endif %}
150
+ {% unless site.tags == empty %}
151
+ <div class="boxy short">
152
+ <p>This would be nicer if we could get the number of articles for each tag.</p>
153
+ <h3>tags: </h3>
154
+ <ul>
155
+ {% for tag in site.tags %}
156
+ <li>{{ tag | link_to_tag }}</li>
157
+ {% endfor %}
158
+ </ul>
159
+ </div>
160
+
161
+ {% endunless %}
162
+ <div class="boxy tall">
163
+ <h3>boxy tall</h3>
164
+ <p>When using a tall box, make sure it's got plenty of content or that it's immediately followed by a short boxy. It might look a bit chopped off otherwise.</p>
165
+ <dl>
166
+ <dt>thing 1</dt>
167
+ <dd><a href="#">value 1</a></dd>
168
+ <dd><a href="#">value 2</a></dd>
169
+ <dd><a href="#">value 3</a></dd>
170
+ <dd><a href="#">value 4</a></dd>
171
+ <dd><a href="#">value 5</a></dd>
172
+ <dd><a href="#">value 6</a></dd>
173
+ <dd><a href="#">value 6</a></dd>
174
+
175
+ <dt>thing 1</dt>
176
+ <dd><a href="#">value 1</a></dd>
177
+ <dd><a href="#">value 2</a></dd>
178
+ <dd><a href="#">value 3</a></dd>
179
+ <dd>value 4</dd>
180
+ <dd>value 5</dd>
181
+ <dd><a href="#">value 6</a></dd>
182
+ <dd><a href="#">value 6</a></dd>
183
+
184
+ </dl>
185
+ </div>
186
+
187
+ </div>
188
+
189
+ </div>
190
+
191
+ <div id="options">
192
+ <h2>Options:</h2>
193
+ <h3>Size</h3>
194
+ <ul id="option_size">
195
+ <li id="option_size_fixed" class="fixed" ><a><span>fixed </span></a></li>
196
+ <li id="option_size_fluid" class="fluid" ><a><span>fluid </span></a></li>
197
+ </ul>
198
+ <h3>Colors</h3>
199
+ <ul id="option_color">
200
+ <li id="option_color_orange" class="orange"><a><span>orange</span></a></li>
201
+ <li id="option_color_blue" class="blue" ><a><span>blue </span></a></li>
202
+ <li id="option_color_green" class="green" ><a><span>green </span></a></li>
203
+ <li id="option_color_pink" class="pink" ><a><span>pink </span></a></li>
204
+ <li id="option_color_cyan" class="cyan" ><a><span>cyan </span></a></li>
205
+ <li id="option_color_red" class="red" ><a><span>red </span></a></li>
206
+ <li id="option_color_violet" class="violet"><a><span>violet</span></a></li>
207
+ </ul>
208
+ </div>
209
+
210
+ <div id="footer">
211
+ <p>Copyright &copy; 2006, Your Name. Valid <a href="http://validator.w3.org/check/referer">XHTML</a> and <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>.</p>
212
+ <p>Using <a href="http://evil.che.lu/projects/skittlish">skittlish</a> on <a href="http://publishwithimpunity.com/">mephisto</a>.</p>
213
+ </div>
214
+
215
+ </div>
216
+
217
+ </body>
218
+
219
+ </html>
@@ -0,0 +1,221 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ {{ '/feed/atom.xml' | assign_to: 'global_feed' }}
4
+ {{ '/feed/all_comments.xml' | assign_to: 'global_comments_feed' }}
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <title>
8
+ {{ site.title }}
9
+ {% if site.current_section %}
10
+ - {{ site.current_section.name }}
11
+ {% endif %}
12
+ {% if article %}
13
+ - {{ article.title }}
14
+ {% endif %}
15
+ </title>
16
+ <link rel="alternate" type="application/atom+xml" title="{{ site.title }} feed" href="{{ global_feed }}"/>
17
+ <link rel="alternate" type="application/atom+xml" title="{{ site.title }} comments feed" href="{{ global_comments_feed }}"/>
18
+ {{ 'base' | stylesheet }}
19
+ {{ 'app' | javascript }}
20
+ <!--[if IE]>
21
+ {{ 'base_ie' | stylesheet }}
22
+ <![endif]-->
23
+ </head>
24
+
25
+ <body class="fixed green">
26
+ <script type="text/javascript">loadPreferences()</script>
27
+
28
+ <div id="wrapper">
29
+
30
+ <div id="header" class="clearfix">
31
+ <div id="title" class="clearfix">
32
+ <h1><a href="/">{{ site.title }}</a></h1>
33
+ </div>
34
+ <h2>Sections</h2>
35
+ <ul id="menu">
36
+ {% for section in site.sections %}
37
+ {% if section.articles_count > 0 %}
38
+ {% if section.is_home %}
39
+ <li{% if section.current %} class="selected"{% endif %}>{{ section | link_to_section }}</li>
40
+ {% else %}
41
+ {% if section.is_paged %}
42
+ <li{% if section.current %} class="selected"{% endif %}>{{ section | link_to_section }}</li>
43
+ {% endif %}
44
+ {% endif %}
45
+ {% endif %}
46
+ {% endfor %}
47
+ </ul>
48
+ </div>
49
+
50
+ <div id="contentwrapper" class="clearfix">
51
+
52
+ <div id="content">
53
+
54
+ <div id="innerwrapper">
55
+
56
+ <div class="article">
57
+ <div class="body">
58
+ <h2>Skittlish Tips'n'Tricks</h2>
59
+ <ul>
60
+ <li>Change the classes for the body tag to set your default site style. also change these in the app.js file (line 66).</li>
61
+ <li>Remove the scripts and the #options div if you don't want the option switcher.</li>
62
+ <li>The top menu shows the home section and the sections that are not blogs.</li>
63
+ <li>Email me at <a href="mailto:evil@che.lu">evil@che.lu</a> if you have any questions.</li>
64
+ <li>Happy hacking!</li>
65
+ </ul>
66
+ </div>
67
+ </div>
68
+
69
+ {{ content_for_layout }}
70
+
71
+ </div>
72
+
73
+ </div>
74
+
75
+ <div id="sidebar">
76
+
77
+ <div class="boxy short">
78
+ <h3>boxy short</h3>
79
+
80
+ <p>You can have, boxes with a short, tall or no background shade, just change the class of the containing div.</p>
81
+
82
+ <p>Have boxes with smaller text with the class "minor". See the "Recent" boxy below.</p>
83
+
84
+ <p>Happy boxying!</p>
85
+
86
+ </div>
87
+
88
+ <div id="search" class="boxy short">
89
+ <h3>Search</h3>
90
+ <form method="get" action="/search">
91
+ <fieldset>
92
+ <input class="text" type="text" id="q" value="" name="q"/>
93
+ </fieldset>
94
+ </form>
95
+ </div>
96
+
97
+ <div class="boxy tall minor">
98
+ <h3>Recent</h3>
99
+
100
+ <dl>
101
+ <dt>Articles <a class="feed" href="{{ global_feed }}"><span>feed</span></a></dt>
102
+ <dd>
103
+ <ul>
104
+ {% for article in site.latest_articles %}
105
+ <li>{{ article | link_to_article }} <em>({{ article.published_at | format_date: 'stub', true }})</em></li>
106
+ {% endfor %}
107
+ </ul>
108
+ </dd>
109
+
110
+ <dt>Comments <a class="feed" href="{{ global_comments_feed }}"><span>feed</span></a></dt>
111
+ <dd>
112
+ <ul>
113
+ {% for comment in site.latest_comments %}
114
+ <li>{{ comment.author_link }} on <a href="{{ comment.url }}#comment-{{ comment.id }}">{{ comment.title }}</a></li>
115
+ {% endfor %}
116
+ </ul>
117
+ </dd>
118
+ </dl>
119
+ </div>
120
+
121
+ <div class="boxy short">
122
+ <h3>Archives</h3>
123
+ <p>This would be much nicer with jamis' month_drop thingy.</p>
124
+ {{ '' | section | months | assign_to: 'home_section' }}
125
+ <ul>
126
+ {% for month in home_section.months %}
127
+ {{ home_section | monthly_articles: month | size | assign_to: 'articles_count' }}
128
+ {% if articles_count > 0 %}
129
+ <li>{{ home_section | link_to_month: month }} ({{ articles_count }})</li>
130
+ {% endif %}
131
+ {% endfor %}
132
+ </ul>
133
+ </div>
134
+
135
+ {% if site.blog_sections.size > 1 %}
136
+ <div class="boxy short">
137
+ <h3>Categories</h3>
138
+ <p>Lists only blog type categories with at least one article.</p>
139
+ <p>This list uses an ul. You could use a dl with only dd's in it for the same effect. Wouldn't be semantic tho.</p>
140
+ <ul class="sections">
141
+ {% for section in site.blog_sections %}
142
+ {% if section.articles_count > 0 %}
143
+ {% unless section.is_home %}
144
+ <li>{{ section | link_to_section }} ({{ section.articles_count }})</li>
145
+ {% endunless %}
146
+ {% endif %}
147
+ {% endfor %}
148
+ </ul>
149
+ </div>
150
+
151
+ {% endif %}
152
+ {% unless site.tags == empty %}
153
+ <div class="boxy short">
154
+ <p>This would be nicer if we could get the number of articles for each tag.</p>
155
+ <h3>tags: </h3>
156
+ <ul>
157
+ {% for tag in site.tags %}
158
+ <li>{{ tag | link_to_tag }}</li>
159
+ {% endfor %}
160
+ </ul>
161
+ </div>
162
+
163
+ {% endunless %}
164
+ <div class="boxy tall">
165
+ <h3>boxy tall</h3>
166
+ <p>When using a tall box, make sure it's got plenty of content or that it's immediately followed by a short boxy. It might look a bit chopped off otherwise.</p>
167
+ <dl>
168
+ <dt>thing 1</dt>
169
+ <dd><a href="#">value 1</a></dd>
170
+ <dd><a href="#">value 2</a></dd>
171
+ <dd><a href="#">value 3</a></dd>
172
+ <dd><a href="#">value 4</a></dd>
173
+ <dd><a href="#">value 5</a></dd>
174
+ <dd><a href="#">value 6</a></dd>
175
+ <dd><a href="#">value 6</a></dd>
176
+
177
+ <dt>thing 1</dt>
178
+ <dd><a href="#">value 1</a></dd>
179
+ <dd><a href="#">value 2</a></dd>
180
+ <dd><a href="#">value 3</a></dd>
181
+ <dd>value 4</dd>
182
+ <dd>value 5</dd>
183
+ <dd><a href="#">value 6</a></dd>
184
+ <dd><a href="#">value 6</a></dd>
185
+
186
+ </dl>
187
+ </div>
188
+
189
+ </div>
190
+
191
+ </div>
192
+
193
+ <div id="options">
194
+ <h2>Options:</h2>
195
+ <h3>Size</h3>
196
+ <ul id="option_size">
197
+ <li id="option_size_fixed" class="fixed" ><a><span>fixed </span></a></li>
198
+ <li id="option_size_fluid" class="fluid" ><a><span>fluid </span></a></li>
199
+ </ul>
200
+ <h3>Colors</h3>
201
+ <ul id="option_color">
202
+ <li id="option_color_orange" class="orange"><a><span>orange</span></a></li>
203
+ <li id="option_color_blue" class="blue" ><a><span>blue </span></a></li>
204
+ <li id="option_color_green" class="green" ><a><span>green </span></a></li>
205
+ <li id="option_color_pink" class="pink" ><a><span>pink </span></a></li>
206
+ <li id="option_color_cyan" class="cyan" ><a><span>cyan </span></a></li>
207
+ <li id="option_color_red" class="red" ><a><span>red </span></a></li>
208
+ <li id="option_color_violet" class="violet"><a><span>violet</span></a></li>
209
+ </ul>
210
+ </div>
211
+
212
+ <div id="footer">
213
+ <p>Copyright &copy; 2006, Your Name. Valid <a href="http://validator.w3.org/check/referer">XHTML</a> and <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>.</p>
214
+ <p>Using <a href="http://evil.che.lu/projects/skittlish">skittlish</a> on <a href="http://publishwithimpunity.com/">mephisto</a>.</p>
215
+ </div>
216
+
217
+ </div>
218
+
219
+ </body>
220
+
221
+ </html>
@@ -0,0 +1,80 @@
1
+ require File.dirname(__FILE__) + '/../integration_helper'
2
+
3
+ describe "Adding a mirror in a clean repository" do
4
+
5
+ before do
6
+ FileUtils.rm_rf(TMP_PATH)
7
+ FileUtils.mkdir_p(TMP_PATH)
8
+ end
9
+
10
+ describe "from a git repository" do
11
+ before do
12
+ @shiny = create_git_repo_from_fixture("shiny")
13
+ @skit1 = create_git_repo_from_fixture("skit1")
14
+ end
15
+
16
+ it "should add the files and commit" do
17
+ in_dir(@shiny) do
18
+ `#{BRAID_BIN} add --type git #{@skit1}`
19
+ end
20
+
21
+ file_name = "skit1/layouts/layout.liquid"
22
+ output = `diff -U 3 #{File.join(FIXTURE_PATH, file_name)} #{File.join(TMP_PATH, "shiny", file_name)}`
23
+ $?.should.be.success
24
+
25
+ output = `git log --pretty=oneline`.split("\n")
26
+ output.length.should == 2
27
+ output[0].should =~ "Add mirror 'skit1/'"
28
+ end
29
+
30
+ it "should create .braids and add the mirror to it" do
31
+ in_dir(@shiny) do
32
+ `#{BRAID_BIN} add --type git #{@skit1}`
33
+ end
34
+
35
+ braids = YAML::load_file("#{@shiny}/.braids")
36
+ braids["skit1"]["squashed"].should == true
37
+ braids["skit1"]["url"].should == @skit1
38
+ braids["skit1"]["type"].should == "git"
39
+ braids["skit1"]["revision"].should.not.be nil
40
+ braids["skit1"]["branch"].should == "master"
41
+ braids["skit1"]["remote"].should == "braid/skit1"
42
+ end
43
+ end
44
+
45
+ describe "from an svn repository" do
46
+ before do
47
+ @shiny = create_git_repo_from_fixture("shiny")
48
+ @skit1 = create_svn_repo_from_fixture("skit1")
49
+ end
50
+
51
+ it "should add the files and commit" do
52
+ in_dir(@shiny) do
53
+ `#{BRAID_BIN} add --type svn #{@skit1}`
54
+ end
55
+
56
+ file_name = "skit1/layouts/layout.liquid"
57
+ output = `diff -U 3 #{File.join(FIXTURE_PATH, file_name)} #{File.join(TMP_PATH, "shiny", file_name)}`
58
+ $?.should.be.success
59
+
60
+ output = `git log --pretty=oneline`.split("\n")
61
+ output.length.should == 2
62
+ output[0].should =~ "Add mirror 'skit1/'"
63
+ end
64
+
65
+ it "should create .braids and add the mirror to it" do
66
+ in_dir(@shiny) do
67
+ `#{BRAID_BIN} add --type svn #{@skit1}`
68
+ end
69
+
70
+ braids = YAML::load_file("#{@shiny}/.braids")
71
+ braids["skit1"]["squashed"].should == true
72
+ braids["skit1"]["url"].should == @skit1
73
+ braids["skit1"]["type"].should == "svn"
74
+ braids["skit1"]["revision"].should == 1
75
+ braids["skit1"]["remote"].should == "braid/skit1"
76
+ braids["skit1"]["branch"].should.be == nil
77
+ end
78
+ end
79
+
80
+ end
@@ -0,0 +1,87 @@
1
+ require File.dirname(__FILE__) + '/../integration_helper'
2
+
3
+ describe "Updating a mirror without conflicts" do
4
+
5
+ before do
6
+ FileUtils.rm_rf(TMP_PATH)
7
+ FileUtils.mkdir_p(TMP_PATH)
8
+ end
9
+
10
+ describe "from a git repository" do
11
+ before do
12
+ @shiny = create_git_repo_from_fixture("shiny")
13
+ @skit1 = create_git_repo_from_fixture("skit1")
14
+
15
+ in_dir(@shiny) do
16
+ `#{BRAID_BIN} add --type git #{@skit1}`
17
+ end
18
+
19
+ update_dir_from_fixture("skit1", "skit1.1")
20
+ in_dir(@skit1) do
21
+ `git add *`
22
+ `git commit -m "change default color"`
23
+ end
24
+
25
+ update_dir_from_fixture("skit1", "skit1.2")
26
+ in_dir(@skit1) do
27
+ `git add *`
28
+ `git commit -m "add a happy note"`
29
+ end
30
+
31
+ end
32
+
33
+ it "should add the files and commit" do
34
+ in_dir(@shiny) do
35
+ `#{BRAID_BIN} update skit1`
36
+ end
37
+
38
+ file_name = "layouts/layout.liquid"
39
+ output = `diff -U 3 #{File.join(FIXTURE_PATH, "skit1.2", file_name)} #{File.join(TMP_PATH, "shiny", "skit1", file_name)}`
40
+ $?.should.be.success
41
+
42
+ output = `git log --pretty=oneline`.split("\n")
43
+ output.length.should == 3
44
+ output[0].should =~ "Update mirror 'skit1/' to HEAD"
45
+ end
46
+
47
+ end
48
+
49
+ describe "from a svn repository" do
50
+ before do
51
+ @shiny = create_git_repo_from_fixture("shiny")
52
+ @skit1 = create_svn_repo_from_fixture("skit1")
53
+ @skit1_wc = File.join(TMP_PATH, "skit1_wc")
54
+
55
+ in_dir(@shiny) do
56
+ `#{BRAID_BIN} add --type svn #{@skit1}`
57
+ end
58
+
59
+ update_dir_from_fixture("skit1_wc", "skit1.1")
60
+ in_dir(@skit1_wc) do
61
+ `svn commit -m "change default color"`
62
+ end
63
+
64
+ update_dir_from_fixture("skit1_wc", "skit1.2")
65
+ in_dir(@skit1_wc) do
66
+ `svn commit -m "add a happy note"`
67
+ end
68
+
69
+ end
70
+
71
+ it "should add the files and commit" do
72
+ in_dir(@shiny) do
73
+ `#{BRAID_BIN} update skit1`
74
+ end
75
+
76
+ file_name = "layouts/layout.liquid"
77
+ output = `diff -U 3 #{File.join(FIXTURE_PATH, "skit1.2", file_name)} #{File.join(TMP_PATH, "shiny", "skit1", file_name)}`
78
+ $?.should.be.success
79
+
80
+ output = `git log --pretty=oneline`.split("\n")
81
+ output.length.should == 3
82
+ output[0].should =~ "Update mirror 'skit1/' to HEAD"
83
+ end
84
+
85
+ end
86
+
87
+ end
@@ -0,0 +1,69 @@
1
+ require 'rubygems'
2
+ require 'test/spec'
3
+ require 'mocha'
4
+
5
+ require 'tempfile'
6
+ require 'fileutils'
7
+ require 'pathname'
8
+
9
+ TMP_PATH = File.join(Dir.tmpdir, "braid_integration")
10
+ BRAID_PATH = Pathname.new(File.dirname(__FILE__)).parent.realpath
11
+ FIXTURE_PATH = File.join(BRAID_PATH, "test", "fixtures")
12
+ FileUtils.mkdir_p(TMP_PATH)
13
+ BRAID_BIN = File.join(BRAID_PATH, "bin", "braid")
14
+
15
+ #def exec(cmd)
16
+ # `cd #{TMP} && #{cmd}`
17
+ #end
18
+
19
+ def in_dir(dir = TMP_PATH)
20
+ Dir.chdir(dir)
21
+ yield
22
+ end
23
+
24
+ def run_cmds(ary)
25
+ ary.each do |cmd|
26
+ cmd = cmd.strip!
27
+ out = `#{cmd}`
28
+ end
29
+ end
30
+
31
+ def update_dir_from_fixture(dir, fixture = dir)
32
+ to_dir = File.join(TMP_PATH, dir)
33
+ FileUtils.mkdir_p(to_dir)
34
+ FileUtils.cp_r(File.join(FIXTURE_PATH, fixture) + "/.", to_dir)
35
+ end
36
+
37
+ def create_git_repo_from_fixture(fixture_name)
38
+ git_repo = File.join(TMP_PATH, fixture_name)
39
+ update_dir_from_fixture(fixture_name)
40
+
41
+ in_dir(git_repo) do
42
+ run_cmds(<<-EOD)
43
+ git init
44
+ git add *
45
+ git commit -m "initial commit of #{fixture_name}"
46
+ EOD
47
+ end
48
+
49
+ git_repo
50
+ end
51
+
52
+ def create_svn_repo_from_fixture(fixture_name)
53
+ svn_wc = File.join(TMP_PATH, fixture_name + "_wc")
54
+ svn_repo = File.join(TMP_PATH, fixture_name)
55
+ run_cmds(<<-EOD)
56
+ svnadmin create #{svn_repo}
57
+ svn co file://#{svn_repo} #{svn_wc}
58
+ EOD
59
+ update_dir_from_fixture(fixture_name + "_wc", fixture_name)
60
+ in_dir(svn_wc) do
61
+ run_cmds(<<-EOD)
62
+ svn add *
63
+ svn commit -m "initial commit of #{fixture_name}"
64
+ EOD
65
+ end
66
+ "file://#{svn_repo}"
67
+ end
68
+
69
+
data/test/mirror_test.rb CHANGED
@@ -92,3 +92,27 @@ describe "Braid::Mirror#inferred_revision" do
92
92
  @mirror.send(:inferred_revision).should == 'b' * 40
93
93
  end
94
94
  end
95
+
96
+ describe "Braid::Mirror#cached_url" do
97
+ it "should return a valid local cache name" do
98
+ @mirror = new_from_options("git://remoteurl/path/to/repo.git")
99
+ @mirror.cached_url.should == "#{ENV["HOME"]}/.braid/cache/git___remoteurl_path_to_repo.git"
100
+
101
+ @mirror = new_from_options("git@remoteurl/path/to/repo.git")
102
+ @mirror.cached_url.should == "#{ENV["HOME"]}/.braid/cache/git_remoteurl_path_to_repo.git"
103
+
104
+ @mirror = new_from_options("remoteurl/path/to/repo/", "type" => "git")
105
+ @mirror.cached_url.should == "#{ENV["HOME"]}/.braid/cache/remoteurl_path_to_repo"
106
+ end
107
+ end
108
+
109
+ describe "Braid::Mirror#init_or_fetch_local_cache" do
110
+ it "should " do
111
+ @mirror = new_from_options("git@remoteurl/path/to/repo.git")
112
+ git_cache.expects(:init_or_fetch).with("git@remoteurl/path/to/repo.git", "#{ENV["HOME"]}/.braid/cache/git_remoteurl_path_to_repo.git")
113
+ @mirror.init_or_fetch_local_cache
114
+ end
115
+
116
+ end
117
+
118
+
@@ -67,3 +67,8 @@ describe "Braid::Operations::Git#require_version" do
67
67
  end
68
68
  end
69
69
  end
70
+
71
+ describe "Braid::Operations::GitCache#init_or_fetch" do
72
+ it "should initialize or fetch a local clone of the given url in the given directory" do
73
+ end
74
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: norbert-braid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cristi Balan
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2008-09-06 00:00:00 -07:00
13
+ date: 2008-10-04 00:00:00 -07:00
14
14
  default_executable: braid
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -40,11 +40,8 @@ extensions: []
40
40
  extra_rdoc_files:
41
41
  - README.rdoc
42
42
  files:
43
- - LICENSE
44
- - README.rdoc
45
- - Rakefile
46
- - braid.gemspec
47
43
  - bin/braid
44
+ - braid.gemspec
48
45
  - lib/braid/command.rb
49
46
  - lib/braid/commands/add.rb
50
47
  - lib/braid/commands/diff.rb
@@ -55,8 +52,19 @@ files:
55
52
  - lib/braid/mirror.rb
56
53
  - lib/braid/operations.rb
57
54
  - lib/braid.rb
55
+ - LICENSE
56
+ - Rakefile
57
+ - README.rdoc
58
58
  - test/braid_test.rb
59
59
  - test/config_test.rb
60
+ - test/fixtures/shiny/README
61
+ - test/fixtures/skit1/layouts/layout.liquid
62
+ - test/fixtures/skit1/preview.png
63
+ - test/fixtures/skit1.1/layouts/layout.liquid
64
+ - test/fixtures/skit1.2/layouts/layout.liquid
65
+ - test/integration/adding_test.rb
66
+ - test/integration/updating_test.rb
67
+ - test/integration_helper.rb
60
68
  - test/mirror_test.rb
61
69
  - test/operations_test.rb
62
70
  - test/test_helper.rb