Sha256: c0de37ad9ab8c51740120c643f89f7cf43b2caa08c0fa5d83529a3f0542843f3

Contents?: true

Size: 1.2 KB

Versions: 52

Compression:

Stored size: 1.2 KB

Contents

class Brief::Epic
  include Brief::Model

  meta do
    title
    subheading
    status String, :in => %w(draft published)
  end

  example <<-EOF
---
type: epic
status: draft
---

# Epic Title

Write a description for your epic.

# Features

## Feature Title

As a **PERSONA** I would like to **BEHAVIOR** so that I can **GOAL**
  EOF

  template <<-EOF
# <%= object.title %>
# Features
<% Array(object.features).each do |feature| %>
## <%= feature.title %>
As a **User** I would like to **Do this** so that I can **succeed**
<% end %>
  EOF

  content do
    title "h1:first-of-type"
    define_section "Features" do
      each("h2").has(:title     => "h2",
                     :paragraph => "p:first-of-type",
                     :components   => "p:first-of-type strong"
                    )

      each("h2").is_a :feature
    end
  end

  helpers do
    def features
      sections.features.items.map do |item|
        item.components = Array(item.components)

        item.merge(goal: item.components[2],
                   persona: item.components[0],
                   behavior: item.components[1])
      end
    end
  end

  actions do
    def publish_to_github
    end

    def custom_action
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
brief-1.17.14 spec/fixtures/example/models/epic.rb
brief-1.17.13 spec/fixtures/example/models/epic.rb
brief-1.17.12 spec/fixtures/example/models/epic.rb
brief-1.17.11 spec/fixtures/example/models/epic.rb
brief-1.17.10 spec/fixtures/example/models/epic.rb
brief-1.17.9 spec/fixtures/example/models/epic.rb
brief-1.17.8 spec/fixtures/example/models/epic.rb
brief-1.17.7 spec/fixtures/example/models/epic.rb
brief-1.17.5 spec/fixtures/example/models/epic.rb
brief-1.17.4 spec/fixtures/example/models/epic.rb
brief-1.17.3 spec/fixtures/example/models/epic.rb
brief-1.17.2 spec/fixtures/example/models/epic.rb
brief-1.17.1 spec/fixtures/example/models/epic.rb
brief-1.17.0 spec/fixtures/example/models/epic.rb
brief-1.16.2 spec/fixtures/example/models/epic.rb
brief-1.16.1 spec/fixtures/example/models/epic.rb
brief-1.16.0 spec/fixtures/example/models/epic.rb
brief-1.15.5 spec/fixtures/example/models/epic.rb
brief-1.15.4 spec/fixtures/example/models/epic.rb
brief-1.15.3 spec/fixtures/example/models/epic.rb