Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Hi! I cleaned up your code for you! #6

Open
wants to merge 1 commit into from

0 participants

Gun.io Robot

Hi there!

This is WhitespaceBot. I'm an open-source robot that removes trailing white space in your code, and gives you a gitignore file if you didn't have one!

Why whitespace? Whitespace is an eyesore for developers who use text editors with dark themes. It's not a huge deal, but it's a bit annoying if you use Vim in a terminal. Really, I'm just a proof of concept - GitHub's V3 API allows robots to automatically improve open source projects, and that's really cool. Hopefully, somebody, maybe you!, will fork me and make me even more useful. My owner is funding a bounty to anybody who can add security fixing features to me.

I've only cleaned your most popular project, and I've added you to a list of users not to contact again, so you won't get any more pull requests from me unless you ask. If I'm misbehaving, please email my owner and tell him to turn me off! If this is pull request is of no use to you, please just ignore it.

Thanks!
WhiteSpacebot from Gun.io.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Oct 27, 2011
Gun.io Whitespace Robot Remove whitespace [Gun.io WhitespaceBot] e986269
This page is out of date. Refresh to see the latest.
4 README.md
Source Rendered
@@ -32,7 +32,7 @@ From the command line
32 32 Compile the site
33 33
34 34 # cleans output/ directory. `rm -rf output` works just as well
35   - % rake clean
  35 + % rake clean
36 36
37 37 # compiles content/* and copies static/* to output/
38 38 % nanoc compile
@@ -100,7 +100,7 @@ Or, if you use rsync:
100 100 ## Naming Conventions
101 101
102 102 Hyphens in file names are converted to subdirectories in the output. You decide how you want to organize
103   -your posts.
  103 +your posts.
104 104
105 105 # e.g. These files render to the same output file.
106 106 2010-01-01-post.haml #=> 2010/01/01/post.html
4 Rakefile
@@ -26,7 +26,7 @@ namespace :create do
26 26 template = <<TEMPLATE
27 27 ---
28 28 created_at: #{@ymd}
29   -excerpt:
  29 +excerpt:
30 30 kind: article
31 31 publish: true
32 32 tags: [misc]
@@ -43,7 +43,7 @@ TEMPLATE
43 43
44 44 def calc_path(title)
45 45 year, month_day = @ymd.split('-', 2)
46   - path = "content/" + year + "/"
  46 + path = "content/" + year + "/"
47 47 filename = month_day + "-" + title.parameterize('_') + ".md"
48 48 [path, filename, path + filename]
49 49 end
10 content/2010/01-01-do_not_publish.haml
... ... @@ -1,23 +1,23 @@
1 1 ---
2   -title: Do Not Publish
  2 +title: Do Not Publish
3 3 tags: [ruby, sass]
4 4 created_at: 2010/01/01
5 5 kind: article
6   -publish: false
  6 +publish: false
7 7 ---
8 8 %p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
9 9
10 10 %pre
11 11 :preserve
12 12 # Test width for 80 chars of code
13   -
  13 +
14 14 #1234566789012345667890123456678901234566789012345667890123456678901234566789012345667890
15 15 def foo
16 16 "bar"
17 17 end
18   -
  18 +
19 19 def baz
20 20 "rutten"
21 21 end
22   -
  22 +
23 23 %p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
4 content/2010/01-01-ruby_article.haml
@@ -14,9 +14,9 @@ excerpt: About my new favorite language
14 14 def foo
15 15 "bar"
16 16 end
17   -
  17 +
18 18 def baz
19 19 "rutten"
20 20 end
21   -
  21 +
22 22 %p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
8 content/2010/01-03-stylesheet_article.haml
@@ -7,15 +7,15 @@ excerpt: About different stylesheet processors
7 7
8 8 .body
9 9 %p Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
10   -
  10 +
11 11 %p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
12   -
  12 +
13 13 %pre
14 14 :preserve
15 15 body
16 16 background-color: #fff
17   -
18   - %p becomes
  17 +
  18 + %p becomes
19 19
20 20 %pre
21 21 :preserve
6 content/2010/01-15-getting_started_with_nanoc3_blog.html.md
Source Rendered
... ... @@ -1,5 +1,5 @@
1 1 ---
2   -title: Getting Started With nanoc3_blog
  2 +title: Getting Started With nanoc3_blog
3 3 kind: article
4 4 tags: [haml, nanoc3, sass]
5 5 created_at: 2010/01/15
@@ -26,7 +26,7 @@ From the command line
26 26 Compile the site
27 27
28 28 # cleans output/ directory. `rm -rf output` works just as well
29   - % rake clean
  29 + % rake clean
30 30
31 31 # compiles content/* and copies static/* to output/
32 32 % nanoc compile
@@ -60,7 +60,7 @@ Edit the Markdown file created by running this command:
60 60 # filename is written to console
61 61 % rake create:article title='Hello world'
62 62
63   -After compiling or refresh in preview mode, view your page from the front page, archives link and tags link
  63 +After compiling or refresh in preview mode, view your page from the front page, archives link and tags link
64 64 if you entered tags.
65 65
66 66
4 content/about.md
Source Rendered
@@ -10,7 +10,7 @@ The blog compiles into pure HTML. No javascript (keeping it simple). Ultra-fast
10 10 Source is available from my [nanoc3_blog](http://github.com/mgutz/nanoc3_blog) github repository.
11 11 Source is provided under the [FreeBSD License](/license.html).
12 12
13   -Features:
  13 +Features:
14 14
15 15 - Minimalist CSS site
16 16 - Uses file extension to determine filter:
@@ -35,7 +35,7 @@ Visit [my blog](http://mgutz.com)
35 35
36 36 ## Thanks
37 37
38   -Thanks to everyone in the
  38 +Thanks to everyone in the
39 39 [nanoc group](http://groups.google.com/group/nanoc)
40 40 for sample code.
41 41
2  content/archives.haml
@@ -12,4 +12,4 @@ is_hidden: true
12 12 %ul
13 13 - item_a.each do |item|
14 14 %li
15   - = render('_excerpt', :item => item)
  15 + = render('_excerpt', :item => item)
4 content/index.haml
@@ -20,8 +20,8 @@ title: nanoc3 blog starter kit
20 20
21 21 - sorted_articles[current_index, excerpt_count].each do |item|
22 22 - oldest_item = item
23   - = render('_excerpt', :item => item)
24   -
  23 + = render('_excerpt', :item => item)
  24 +
25 25 -#= render('_other_articles_nav', :reference_item => oldest_item, :older_only => true)
26 26
27 27 .clear
2  content/license.md
Source Rendered
@@ -17,4 +17,4 @@ permitted provided that the following conditions are met:
17 17
18 18 THIS SOFTWARE IS PROVIDED BY Mario L Gutierrez ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Mario L Gutierrez OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19 19
20   -The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Mario L Gutierrez.
  20 +The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Mario L Gutierrez.
2  content/tags.haml
@@ -5,7 +5,7 @@ is_hidden: true
5 5
6 6 %h1
7 7 All Tags
8   -
  8 +
9 9 %p Listed are the set of tag links related to articles in this site. The number of articles related to a tag succeeds the tag.
10 10
11 11 .tags-page
4 layouts/_article.haml
@@ -3,12 +3,12 @@
3 3
4 4 - is_embedded ||= false
5 5 .article
6   - %h1
  6 + %h1
7 7 - if is_embedded
8 8 %a(href="#{route_path(item)}" title="Full article" class="permalink")= item[:title]
9 9 - else
10 10 = item[:title]
11   -
  11 +
12 12 = render('_meta', :item => item)
13 13
14 14 .body
4 layouts/_excerpt.haml
@@ -2,10 +2,10 @@
2 2 ---
3 3 .excerpt
4 4 - url = "#{route_path(item)}"
5   - %h2
  5 + %h2
6 6 %a(href="#{url}" title="Full article" class="permalink")= "&laquo; #{item[:title]}"
7 7 .body
8 8 %p
9 9 = item[:excerpt] || "!!! Missing excerpt metadata for <code>#{item[:file].path}</code>"
10 10 -# = render('_meta', :item => item)
11   -
  11 +
2  layouts/_meta.haml
@@ -4,7 +4,7 @@
4 4 .meta
5 5 %ul.tags
6 6 %li= pretty_time(item[:created_at])
7   - - if disqus_shortname
  7 + - if disqus_shortname
8 8 - @config[:include_disqus_js] = true
9 9 %li
10 10 &middot;
2  layouts/_other_articles_nav.haml
@@ -17,4 +17,4 @@
2  layouts/_tag_page.haml
@@ -5,4 +5,4 @@
5 5
6 6 .tag-page
7 7 - items_with_tag(tag).each do |item|
8   - = render('_excerpt', :item => item)
  8 + = render('_excerpt', :item => item)
12 layouts/default.haml
@@ -6,15 +6,15 @@
6 6
7 7 def keywords
8 8 if is_front_page?
9   - tag_set.join(', ')
  9 + tag_set.join(', ')
10 10 else
11   - tags = @item[:tags].nil? ? '' : @item[:tags].join(', ')
  11 + tags = @item[:tags].nil? ? '' : @item[:tags].join(', ')
12 12 keywords = @item[:keywords] || ''
13 13 [keywords, tags].join(', ')
14 14 end
15 15 end
16 16 def link_unless_current(s)
17   - "<li><a href='/#{s}.html'>#{s}</a></li>" if @item.identifier != "/#{s}/"
  17 + "<li><a href='/#{s}.html'>#{s}</a></li>" if @item.identifier != "/#{s}/"
18 18 end
19 19 def logo
20 20 if is_front_page?
@@ -38,7 +38,7 @@
38 38 -# needed since some content render <pre> blocks
39 39 - content = find_and_preserve(yield)
40 40 #main
41   - #header
  41 + #header
42 42 .logo
43 43 = logo
44 44 #nav
@@ -62,7 +62,7 @@
62 62 = content
63 63 .clear
64 64
65   - -# disqus: inserts number of commments
  65 + -# disqus: inserts number of commments
66 66 - if @config[:include_disqus_js] == true
67 67 :javascript
68 68 (function() {
@@ -75,5 +75,5 @@
75 75 }
76 76 document.write('<script charset="utf-8" type="text/javascript" src="http://disqus.com/forums/#{disqus_shortname}/get_num_replies.js' + query + '"></' + 'script>');
77 77 })();
78   -
  78 +
79 79 = render('_ganalytics')
6 lib/file_changes.rb
@@ -43,9 +43,9 @@ def status(filename, created_at = nil, content = nil)
43 43 item[:digest] = digest
44 44 @changes[filename.to_sym] = item
45 45 write_changes
46   - elsif item[:digest] != digest
  46 + elsif item[:digest] != digest
47 47 item[:updated_at] = File.mtime(filename)
48   - item[:digest] = digest
  48 + item[:digest] = digest
49 49 write_changes
50 50 end
51 51
@@ -56,7 +56,7 @@ def status(filename, created_at = nil, content = nil)
56 56
57 57 def write_changes
58 58 File.open(@store_filename, 'w') do |f|
59   - YAML.dump @changes, f
  59 + YAML.dump @changes, f
60 60 end
61 61 end
62 62 end
20 lib/helpers.rb
@@ -14,13 +14,13 @@
14 14 #
15 15 # If the output file does not end with an .html extension, item[:layout] is set to 'none'
16 16 # bypassing the use of layouts.
17   -#
  17 +#
18 18 def route_path(item)
19 19 # in-memory items have not file
20 20 return item.identifier + "index.html" if item[:content_filename].nil?
21   -
  21 +
22 22 url = item[:content_filename].gsub(/^content/, '')
23   -
  23 +
24 24 # determine output extension
25 25 extname = '.' + item[:extension].split('.').last
26 26 outext = '.haml'
@@ -32,7 +32,7 @@ def route_path(item)
32 32 outext = '.html'
33 33 end
34 34 url.gsub!(extname, outext)
35   -
  35 +
36 36 if url.include?('-')
37 37 url = url.split('-').join('/') # /2010/01/01-some_title.html -> /2010/01/01/some_title.html
38 38 end
@@ -79,12 +79,12 @@ def add_update_item_attributes
79 79
80 80 # Copy static assets outside of content instead of having nanoc3 process them.
81 81 def copy_static
82   - FileUtils.cp_r 'static/.', 'output/'
  82 + FileUtils.cp_r 'static/.', 'output/'
83 83 end
84 84
85 85 def partial(identifier_or_item)
86 86 item = !item.is_a?(Nanoc3::Item) ? identifier_or_item : item_by_identifier(identifier_or_item)
87   - item.compiled_content(:snapshot => :pre)
  87 + item.compiled_content(:snapshot => :pre)
88 88 end
89 89
90 90 def item_by_identifier(identifier)
@@ -107,7 +107,7 @@ def articles_by_year_month
107 107
108 108 if current_month != d.month
109 109 current_month = d.month
110   - month_a = year_h[current_month] = []
  110 + month_a = year_h[current_month] = []
111 111 end
112 112
113 113 month_a << item
@@ -124,7 +124,7 @@ def is_front_page?
124 124 def n_newer_articles(n, reference_item)
125 125 @sorted_articles ||= sorted_articles
126 126 index = @sorted_articles.index(reference_item)
127   -
  127 +
128 128 # n = 3, index = 4
129 129 if index >= n
130 130 @sorted_articles[index - n, n]
@@ -139,7 +139,7 @@ def n_newer_articles(n, reference_item)
139 139 def n_older_articles(n, reference_item)
140 140 @sorted_articles ||= sorted_articles
141 141 index = @sorted_articles.index(reference_item)
142   -
  142 +
143 143 # n = 3, index = 4, length = 6
144 144 length = @sorted_articles.length
145 145 if index < length
@@ -166,7 +166,7 @@ def excerpt_count
166 166 @config[:excerpt_count].to_i
167 167 end
168 168
169   -def disqus_shortname
  169 +def disqus_shortname
170 170 @config[:disqus_shortname]
171 171 end
172 172
12 lib/tagging_extra.rb
@@ -8,7 +8,7 @@ module TaggingExtra
8 8 #The tags are only present once in the returned value.
9 9 #When called whithout parameters, all the site items
10 10 #are considered.
11   - def tag_set(items=nil)
  11 + def tag_set(items=nil)
12 12 items = @items if items.nil?
13 13 tags = Set.new
14 14 items.each do |item|
@@ -33,7 +33,7 @@ def items_with_tag(tag, items=nil)
33 33 items = @items if items.nil?
34 34 items.select { |item| has_tag?( item, tag ) }
35 35 end
36   -
  36 +
37 37 #Count the tags in a given collection of items.
38 38 #By default, the method counts tags in all the
39 39 #site items.
@@ -51,13 +51,13 @@ def count_tags(items=nil)
51 51 count
52 52 end
53 53
54   -
  54 +
55 55 #Sort the tags of an item collection (defaults
56 56 #to all site items) in 'n' classes of rank.
57 57 #The rank 0 corresponds to the most frequent
58 58 #tags. The rank 'n-1' to the least frequents.
59 59 #The result is a hash such as: { tag => rank }
60   - def rank_tags(n, items=nil)
  60 + def rank_tags(n, items=nil)
61 61
62 62 items = @items if items.nil?
63 63 count = count_tags( items )
@@ -66,8 +66,8 @@ def rank_tags(n, items=nil)
66 66 count.keys.each do |t|
67 67 max = count[t] if count[t] > max
68 68 min = count[t] if count[t] < min
69   - end
70   - divisor = ( ( max.to_f - min ) / n )
  69 + end
  70 + divisor = ( ( max.to_f - min ) / n )
71 71
72 72 ranks = {}
73 73 count.keys.each do |t|

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.