dimples 1.2.6 → 1.2.7
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.
- checksums.yaml +4 -4
- data/lib/dimples/category.rb +4 -2
- data/lib/dimples/frontable.rb +1 -1
- data/lib/dimples/post.rb +14 -2
- data/lib/dimples/site.rb +0 -5
- data/lib/dimples/version.rb +1 -1
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 3a73dc6ff33514291145038bf268afb9accc0850
         | 
| 4 | 
            +
              data.tar.gz: 2322912a45d40638953802426d010f94b4f244bf
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 9c3e1148fc8dd3c9145cfb89e0dacaeb3dddadfc906625bae5f9a8407f6466cf408133af07a50cbc4f0809a5173c988855e843883928b743f71ea2b26ff141bc
         | 
| 7 | 
            +
              data.tar.gz: b5d15cac9bcb4a3a9bf51e9c4916ceef8d7020060be89d07dbc123fbd59866a05423213bf558e244e834f2620a4964035dc339abb6e08b1d5a24c61c30d4555b
         | 
    
        data/lib/dimples/category.rb
    CHANGED
    
    | @@ -3,14 +3,16 @@ module Dimples | |
| 3 3 | 
             
                include Frontable
         | 
| 4 4 |  | 
| 5 5 | 
             
                attr_accessor :slug
         | 
| 6 | 
            +
                attr_accessor :path
         | 
| 6 7 | 
             
                attr_accessor :name
         | 
| 7 8 | 
             
                attr_accessor :posts
         | 
| 8 9 |  | 
| 9 | 
            -
                def initialize(slug, path | 
| 10 | 
            +
                def initialize(slug, path)
         | 
| 10 11 | 
             
                  @slug = slug
         | 
| 12 | 
            +
                  @path = path
         | 
| 11 13 | 
             
                  @name = @slug.capitalize
         | 
| 12 14 |  | 
| 13 | 
            -
                  read_with_yaml(path) | 
| 15 | 
            +
                  read_with_yaml(path)
         | 
| 14 16 |  | 
| 15 17 | 
             
                  @posts = []
         | 
| 16 18 | 
             
                end
         | 
    
        data/lib/dimples/frontable.rb
    CHANGED
    
    
    
        data/lib/dimples/post.rb
    CHANGED
    
    | @@ -11,7 +11,6 @@ module Dimples | |
| 11 11 | 
             
                attr_accessor :layout
         | 
| 12 12 | 
             
                attr_accessor :slug
         | 
| 13 13 | 
             
                attr_accessor :date
         | 
| 14 | 
            -
                attr_accessor :categories
         | 
| 15 14 | 
             
                attr_accessor :year
         | 
| 16 15 | 
             
                attr_accessor :month
         | 
| 17 16 | 
             
                attr_accessor :day
         | 
| @@ -34,7 +33,7 @@ module Dimples | |
| 34 33 | 
             
                  @date = Time.mktime(parts[1], parts[2], parts[3])
         | 
| 35 34 |  | 
| 36 35 | 
             
                  @layout = @site.config['layouts']['post']
         | 
| 37 | 
            -
                  @categories =  | 
| 36 | 
            +
                  @categories = {}
         | 
| 38 37 |  | 
| 39 38 | 
             
                  @year = @date.strftime('%Y')
         | 
| 40 39 | 
             
                  @month = @date.strftime('%m')
         | 
| @@ -47,6 +46,19 @@ module Dimples | |
| 47 46 | 
             
                  @contents
         | 
| 48 47 | 
             
                end
         | 
| 49 48 |  | 
| 49 | 
            +
                def categories=(slugs)
         | 
| 50 | 
            +
                  @categories = {}
         | 
| 51 | 
            +
             | 
| 52 | 
            +
                  slugs.each do |slug|
         | 
| 53 | 
            +
                    @site.categories[slug].posts << self
         | 
| 54 | 
            +
                    @categories[slug] = @site.categories[slug]
         | 
| 55 | 
            +
                  end
         | 
| 56 | 
            +
                end
         | 
| 57 | 
            +
             | 
| 58 | 
            +
                def categories
         | 
| 59 | 
            +
                  @categories
         | 
| 60 | 
            +
                end
         | 
| 61 | 
            +
             | 
| 50 62 | 
             
                def output_file_path(parent_path)
         | 
| 51 63 | 
             
                  parts = [parent_path]
         | 
| 52 64 |  | 
    
        data/lib/dimples/site.rb
    CHANGED
    
    | @@ -95,11 +95,6 @@ module Dimples | |
| 95 95 | 
             
                  Dir.glob(File.join(@source_paths[:posts], '*.*')).reverse.each do |path|
         | 
| 96 96 | 
             
                    post = @post_class.new(self, path)
         | 
| 97 97 |  | 
| 98 | 
            -
                    post.categories.each do |slug|
         | 
| 99 | 
            -
                      @categories[slug] ||= Dimples::Category.new(slug)
         | 
| 100 | 
            -
                      @categories[slug].posts << post
         | 
| 101 | 
            -
                    end
         | 
| 102 | 
            -
             | 
| 103 98 | 
             
                    %w[year month day].each do |date_type|
         | 
| 104 99 | 
             
                      if @config['generation']["#{date_type}_archives"]
         | 
| 105 100 |  | 
    
        data/lib/dimples/version.rb
    CHANGED