blogue 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99a1b18f0e77e2213458bba2e7f20a720d38e9df
4
- data.tar.gz: 15188b23ea69249bb5af6069c2c4b9caf7ce4c5d
3
+ metadata.gz: 100915b43b37b38959ff89d57f2a7046fb84495a
4
+ data.tar.gz: a55ea04d2a96a1735f193accaa2851facb75028e
5
5
  SHA512:
6
- metadata.gz: 2829448805a1711dfbeaf811d01d746c0ed148e0499706c3cee9cff683b43ddb77a633f7d0a0d79c50b03889d12428b64ffe5dcfcf843f476307d8860aef33c0
7
- data.tar.gz: ddc82555f1a6a662e15a4aa66407bc0c68b1024e008271f708a0b9a0ffa8d321ca3f8a6437cd75d9fc921abc617da9a654ef940fb42fd1c39b4999beff9d40ae
6
+ metadata.gz: c9e3dff238480c01ec952770db7a1e7c2c1299a159c3bd19a299b6b0de4e82ddbd58ad86852f0c807be0a25a081bed745568f601cc9a848e6f3e55472111dbaa
7
+ data.tar.gz: db3f71abba38cfe30b676b98d876f93b999371edd6a2c28503ae9ed63b51c10f9f2b95887203968ee1af57a240004be1f9452f502c8da2fcd7c584be774690d6
@@ -6,7 +6,10 @@ module Blogue
6
6
  end
7
7
 
8
8
  def all
9
- all_post_paths.map(&method(:new)).sort(&method(:sort_posts))
9
+ all_post_paths.
10
+ map(&method(:new)).
11
+ sort(&method(:sort_posts)).
12
+ reject(&:private?)
10
13
  end
11
14
 
12
15
  def all_post_paths
@@ -64,6 +67,10 @@ module Blogue
64
67
  meta_author_name || config_author_name || whoami_author_name
65
68
  end
66
69
 
70
+ def private?
71
+ filename_with_underscore? || meta_private?
72
+ end
73
+
67
74
  def meta
68
75
  YAML.load(
69
76
  body.lines.select do |line|
@@ -97,7 +104,7 @@ module Blogue
97
104
  end
98
105
 
99
106
  def parsed_title
100
- if body.lines.first =~ /^\s*#\s+(.+)$/
107
+ if body.lines.find{ |line| line =~ /^\s*#\s+(.+)$/ }
101
108
  $1
102
109
  end
103
110
  end
@@ -117,5 +124,13 @@ module Blogue
117
124
  def whoami_author_name
118
125
  `whoami`.strip
119
126
  end
127
+
128
+ def filename_with_underscore?
129
+ File.basename(path).starts_with?('_')
130
+ end
131
+
132
+ def meta_private?
133
+ meta['private']
134
+ end
120
135
  end
121
136
  end
@@ -1,3 +1,3 @@
1
1
  module Blogue
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -3822,3 +3822,51 @@ Started GET "/header-title" for 127.0.0.1 at 2013-10-21 01:10:00 -0400
3822
3822
  Processing by PostsController#show as HTML
3823
3823
  Parameters: {"id"=>"header-title"}
3824
3824
  Completed 200 OK in 7ms (Views: 5.7ms)
3825
+ -----------------------------------------------------
3826
+ Blogue::PostTest: test_date_returns_date_part_of_time
3827
+ -----------------------------------------------------
3828
+ ------------------------------------------------------------
3829
+ Blogue::PostTest: test_extract_post_id_extracts_id_from_path
3830
+ ------------------------------------------------------------
3831
+ -------------------------------------------------------------------------------------
3832
+ Blogue::PostTest: test_extract_post_id_extracts_id_from_path_with_multiple_extensions
3833
+ -------------------------------------------------------------------------------------
3834
+ ---------------------------------------
3835
+ Blogue::PostTest: test_finds_post_by_id
3836
+ ---------------------------------------
3837
+ -------------------------------------------------------------
3838
+ Blogue::PostTest: test_sort_posts_reverse-sorts_posts_by_time
3839
+ -------------------------------------------------------------
3840
+ ----------------------------------------------------------------
3841
+ Blogue::PostTest: test_uses_file_creation_time_when_no_meta_date
3842
+ ----------------------------------------------------------------
3843
+ -----------------------------------------------------------------------
3844
+ Blogue::PostTest: test_uses_filename_as_title_when_no_other_alternative
3845
+ -----------------------------------------------------------------------
3846
+ ---------------------------------------------------------------
3847
+ Blogue::PostTest: test_uses_markdown_header_as_title_if_present
3848
+ ---------------------------------------------------------------
3849
+ -------------------------------------------------
3850
+ Blogue::PostTest: test_uses_meta_title_if_present
3851
+ -------------------------------------------------
3852
+ -----------------------------------------------------
3853
+ Blogue::PostTest: test_uses_time_from_meta_when_given
3854
+ -----------------------------------------------------
3855
+ ---------------------------------------------------------------------
3856
+ ConfigurationTest: test_adds_[posts_path]/assets_to_rails_asset_paths
3857
+ ---------------------------------------------------------------------
3858
+ Started GET "/assets/dogue.jpg" for 127.0.0.1 at 2013-10-23 04:01:55 -0400
3859
+ -----------------------------------------------------
3860
+ ConfigurationTest: test_renders_codeblocks_with_rouge
3861
+ -----------------------------------------------------
3862
+ Started GET "/code-block" for 127.0.0.1 at 2013-10-23 04:01:55 -0400
3863
+ Processing by PostsController#show as HTML
3864
+ Parameters: {"id"=>"code-block"}
3865
+ Completed 200 OK in 64ms (Views: 62.0ms)
3866
+ ------------------------------------------------------
3867
+ ConfigurationTest: test_renders_markdown_with_kramdown
3868
+ ------------------------------------------------------
3869
+ Started GET "/header-title" for 127.0.0.1 at 2013-10-23 04:01:55 -0400
3870
+ Processing by PostsController#show as HTML
3871
+ Parameters: {"id"=>"header-title"}
3872
+ Completed 200 OK in 8ms (Views: 6.1ms)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blogue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxim Chernyak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-22 00:00:00.000000000 Z
11
+ date: 2013-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails