playgroundbook 0.6.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -45
  3. data/lib/renderer/chapter_collator.rb +24 -1
  4. data/lib/renderer/page_parser.rb +24 -2
  5. data/lib/renderer/page_writer.rb +20 -1
  6. data/lib/renderer/playgroundbook_renderer.rb +25 -5
  7. data/lib/version.rb +1 -1
  8. metadata +2 -46
  9. data/.gitignore +0 -50
  10. data/.rspec +0 -2
  11. data/.rubocop.yml +0 -112
  12. data/.ruby-version +0 -1
  13. data/Changelog.md +0 -37
  14. data/CodeOfConduct.md +0 -50
  15. data/Community.md +0 -52
  16. data/Gemfile +0 -13
  17. data/Gemfile.lock +0 -102
  18. data/Guardfile +0 -14
  19. data/Rakefile +0 -8
  20. data/playgroundbook.gemspec +0 -21
  21. data/spec/fixtures/Starter.playgroundbook/Contents/Chapters/Chapter1.playgroundchapter/Manifest.plist +0 -15
  22. data/spec/fixtures/Starter.playgroundbook/Contents/Chapters/Chapter1.playgroundchapter/Pages/Page1.playgroundpage/Contents.swift +0 -8
  23. data/spec/fixtures/Starter.playgroundbook/Contents/Chapters/Chapter1.playgroundchapter/Pages/Page1.playgroundpage/Manifest.plist +0 -12
  24. data/spec/fixtures/Starter.playgroundbook/Contents/Chapters/Chapter1.playgroundchapter/Pages/Page2.playgroundpage/Contents.swift +0 -8
  25. data/spec/fixtures/Starter.playgroundbook/Contents/Chapters/Chapter1.playgroundchapter/Pages/Page2.playgroundpage/Manifest.plist +0 -12
  26. data/spec/fixtures/Starter.playgroundbook/Contents/Manifest.plist +0 -20
  27. data/spec/fixtures/assets/file.jpeg +0 -0
  28. data/spec/fixtures/book.yml +0 -6
  29. data/spec/fixtures/test_chapter.playground/Contents.swift +0 -17
  30. data/spec/fixtures/test_chapter.playground/contents.xcplayground +0 -4
  31. data/spec/fixtures/wrapper/destination/swift_at_artsy_1.swift +0 -200
  32. data/spec/fixtures/wrapper/source/Swift-at-Artsy.playground/Contents.swift +0 -199
  33. data/spec/fixtures/wrapper/source/Swift-at-Artsy.playground/contents.xcplayground +0 -4
  34. data/spec/fixtures/wrapper/source/swift_at_artsy_1.md +0 -183
  35. data/spec/linter/chapter_linter_spec.rb +0 -30
  36. data/spec/linter/chapter_manifest_linter_spec.rb +0 -40
  37. data/spec/linter/contents_linter_spec.rb +0 -18
  38. data/spec/linter/cutscene_page_linter_spec.rb +0 -14
  39. data/spec/linter/cutscene_page_manifest_linter_spec.rb +0 -63
  40. data/spec/linter/manfiest_linter_spec.rb +0 -71
  41. data/spec/linter/page_linter_spec.rb +0 -19
  42. data/spec/linter/page_manifest_linter_spec.rb +0 -43
  43. data/spec/linter/playgroundbook_lint_spec.rb +0 -38
  44. data/spec/linter/root_manifest_linter_spec.rb +0 -35
  45. data/spec/renderer/chapter_collator_spec.rb +0 -70
  46. data/spec/renderer/contents_manfiest_generator_spec.rb +0 -41
  47. data/spec/renderer/glossary_generator_spec.rb +0 -54
  48. data/spec/renderer/page_processor_spec.rb +0 -86
  49. data/spec/renderer/page_writer_spec.rb +0 -70
  50. data/spec/renderer/playgroundbook_renderer_spec.rb +0 -122
  51. data/spec/spec_helper.rb +0 -85
  52. data/spec/wrapper/markdown_wrapper_spec.rb +0 -90
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a6d1f0ed65671bb4c70bf6cbd734b9648b1733ea
4
- data.tar.gz: a40d6882aa7217a9ae7e13c882b1e4607cef78d0
3
+ metadata.gz: 000ecb1a02bff2b04307cd2a25a719a1aa242ae9
4
+ data.tar.gz: 5b30b076d2763c7132140535c2258b67221ef8b4
5
5
  SHA512:
6
- metadata.gz: a0a69b41dec9497235562749b007e2321099585d0e5c7f9521da897a1348076891469e3cdecbb9fd61dcdd0b54ad0fd99827f13d5b95d7b611466c01bfe1904f
7
- data.tar.gz: d97dc8dc75a1a64bf5f30a1d44e9ecc8b3ba7aee914877b0bfb6b937418308e85b783f07dc754e14206d54902f8776ee9de5eefbac80cf529b6a52f6f3475f8d
6
+ metadata.gz: ebd0b322c996b8a2698e553726319d575998573be3729f8a36af2a75940bd6401f81549e74d50aad1d772b9be8f8cc06108368d3075afa4a08b741b544e94e73
7
+ data.tar.gz: 7e7b5e305994ff92ef6b43200dcf50d8a6b84c3c8775f047a7b8fca4d710a7f88d5461e4148bcd4b8bba5bc9655d800113d78c79f8e6bd05d1d378f4a20bece6
data/README.md CHANGED
@@ -55,32 +55,12 @@ Each chapter needs to have a corresponding playground; so `Chapter 1` requires t
55
55
 
56
56
  Only the link to the term must be URL encoded. For example, the term "reuse identifier" would be defined in the yaml as `reuse identifier` but linked to as `glossary://reuse%20identifier`.
57
57
 
58
- Each chapter needs to be in the following format:
59
-
60
- ```swift
61
- // This is the preamble that is shared among all the pages within this chapter.
62
-
63
- public var str = "Hi!"
64
-
65
- public func sharedFunc() {
66
- print("This should be accessible to all pages.")
67
- }
68
-
69
- //// Page 1
70
-
71
- str = "Yo, it's page 1."
72
- sharedFunc()
73
-
74
- //// Page 2
75
-
76
- sharedFunc()
77
- str = "Page 2 awww yeah."
78
- ```
79
-
80
- Pages are divided by lines beginning with a quadruple slash, followed by that pages name.
58
+ Each page in a chapter's `.playground` will be a separate page in the `.playgroundbook` and it's `Source`. The contents of the `Source` and `Resource` folders for each chapter and each page are copied.
81
59
 
82
60
  ### Limitations of Book Rendering
83
61
 
62
+ Playground books support a rich set of awesome features to make learning how to code really easy, and this tool only scratches the surface. Read over the [Playground Book reference](https://developer.apple.com/library/content/documentation/Xcode/Conceptual/swift_playgrounds_doc_format/) to see all the available options. If you have suggestions, please open an issue :+1:
63
+ =======
84
64
  The preamble (anything about the first `////` page) is put in its own file. That means declarations there need to be `public` to be visible within individual pages (even though when you're writing, everything is in one file). Additionally, the preamble is at the top-level and can't contain expressions. This would cause a compiler error in the Swift Playrounds iPad app:
85
65
 
86
66
  ```swift
@@ -88,28 +68,6 @@ public let layout = UICollectionViewFlowLayout()
88
68
  layout.itemSize = CGSize(width: 20, height: 20)
89
69
  ```
90
70
 
91
- Instead, you have to wrap it in a closure, like this:
92
-
93
- ```swift
94
- public var layout: UICollectionViewFlowLayout = {
95
- let layout = UICollectionViewFlowLayout()
96
- layout.itemSize = CGSize(width: 20, height: 20)
97
- return layout
98
- }()
99
- ```
100
-
101
- It's awkward; if you have suggestions, open an issue :+1:
102
-
103
- Sharing resources is only available book-wide and not specific to chapters. Sharing code outside the preamble isn't supported yet.
104
-
105
- #### Using Swift Package Manager Dependencies
106
-
107
- If you place a `Package.swift` file next to your playgroundbook manifest used for rendering a book and run `swift package fetch` to fetch the corresponding sources into `Packages/`, these will be copied into the playground book's top-level `Sources` when building and available in the finished book.
108
- These source files will also be copied into the original playground for each chapter to make these available for use in Xcode.
109
- Please note that this will work best with SPM packages containing pure Swift.
110
-
111
- Playground books support a rich set of awesome features to make learning how to code really easy, and this tool uses almost none of them. It sacrifices this experience for the sake of being able to easily write the books on your Mac.
112
-
113
71
  ### Creating a Playground from markdown
114
72
 
115
73
  Maybe you want to do something for a website, or a git repo first, and then generate your Playground? Well in those cases your source of truth is the markdown document. For that case, we have `playgroundbook wrapper`.
@@ -1,8 +1,10 @@
1
1
  require "plist"
2
+ require "fileutils"
2
3
  require "renderer/page_writer"
3
4
 
4
5
  module Playgroundbook
5
6
  SharedSourcesDirectoryName = "Sources".freeze
7
+ SharedResourcesDirectoryName = "Resources".freeze
6
8
  PreambleFileName = "Preamble.swift".freeze
7
9
 
8
10
  class ChapterCollator
@@ -26,12 +28,17 @@ module Playgroundbook
26
28
  page_contents = parsed_chapter[:page_contents][index]
27
29
  page_dir_name = parsed_chapter[:page_dir_names][index]
28
30
 
29
- @page_writer.write_page(page_name, page_dir_name, imports, page_contents, chapter)
31
+ page_source_names = parsed_chapter[:page_source_names][index]
32
+ page_resource_names = parsed_chapter[:page_resource_names][index]
33
+
34
+ @page_writer.write_page(page_name, page_dir_name, imports, page_contents, page_source_names, page_resource_names, chapter)
30
35
  end
31
36
  end
32
37
 
33
38
  write_chapter_manifest(chapter_name, parsed_chapter[:page_dir_names])
34
39
  write_preamble(parsed_chapter[:preamble])
40
+ copy_sources(parsed_chapter[:source_names])
41
+ copy_resources(parsed_chapter[:resource_names])
35
42
  end
36
43
  end
37
44
 
@@ -56,5 +63,21 @@ module Playgroundbook
56
63
  end
57
64
  end
58
65
  end
66
+
67
+ def copy_sources(source_names)
68
+ Dir.mkdir(SharedSourcesDirectoryName) unless Dir.exist?(SharedSourcesDirectoryName)
69
+
70
+ source_names.each do |source|
71
+ FileUtils.cp("../../../../#{source}", SharedSourcesDirectoryName)
72
+ end
73
+ end
74
+
75
+ def copy_resources(resource_names)
76
+ Dir.mkdir(SharedResourcesDirectoryName) unless Dir.exist?(SharedResourcesDirectoryName)
77
+
78
+ resource_names.each do |resource|
79
+ FileUtils.cp("../../../../#{resource}", SharedResourcesDirectoryName)
80
+ end
81
+ end
59
82
  end
60
83
  end
@@ -1,6 +1,6 @@
1
1
  module Playgroundbook
2
2
  class PageParser
3
- def parse_chapter_pages(chapter_contents)
3
+ def parse_chapter_pages(chapter_contents, source_names, resource_names)
4
4
  # Looks for //// PageName separators.
5
5
  page_names = chapter_contents.scan(/\/\/\/\/.*$/).map { |p| p.gsub("////", "").strip }
6
6
  page_dir_names = page_names.map { |p| "#{p}.playgroundpage" }
@@ -13,7 +13,29 @@ module Playgroundbook
13
13
  page_dir_names: page_dir_names,
14
14
  page_names: page_names,
15
15
  page_contents: page_contents,
16
- preamble: preamble
16
+ preamble: preamble,
17
+ page_source_names: [[]] * page_names.count, # TODO: Be less hacky
18
+ page_resource_names: [[]] * page_names.count, # TODO: Be less hacky
19
+ source_names: source_names,
20
+ resource_names: resource_names
21
+ }
22
+ end
23
+
24
+ def parse_chapter_xcplaygroundpages(pages_data, source_names, resource_names)
25
+ page_dir_names = pages_data.map { |p| "#{p[:name]}.playgroundpage" }
26
+ page_names = pages_data.map { |p| "#{p[:name]}" }
27
+ page_contents = pages_data.map { |p| "#{p[:contents]}" }
28
+ page_source_names = pages_data.map { |p| p[:sources] }
29
+ page_resource_names = pages_data.map { |p| p[:resources] }
30
+
31
+ {
32
+ page_dir_names: page_dir_names,
33
+ page_names: page_names,
34
+ page_contents: page_contents,
35
+ page_source_names: page_source_names,
36
+ page_resource_names: page_resource_names,
37
+ source_names: source_names,
38
+ resource_names: resource_names
17
39
  }
18
40
  end
19
41
  end
@@ -8,7 +8,7 @@ module Playgroundbook
8
8
  @ui = ui
9
9
  end
10
10
 
11
- def write_page(page_name, page_dir_name, imports, page_contents, chapter_info={})
11
+ def write_page(page_name, page_dir_name, imports, page_contents, page_sources, page_resources, chapter_info={})
12
12
  Dir.mkdir(page_dir_name) unless Dir.exist?(page_dir_name)
13
13
  contents_with_import = "//#-hidden-code\n"
14
14
  contents_with_import += imports.map { |i| "import #{i}" }.join("\n") + "\n"
@@ -29,6 +29,25 @@ module Playgroundbook
29
29
  "ContentVersion" => "1.0"
30
30
  }.to_plist)
31
31
  end
32
+
33
+ copy_page_sources(page_sources)
34
+ copy_page_resources(page_resources)
35
+ end
36
+ end
37
+
38
+ def copy_page_sources(source_names)
39
+ Dir.mkdir(SharedSourcesDirectoryName) unless Dir.exist?(SharedSourcesDirectoryName)
40
+
41
+ source_names.each do |source|
42
+ FileUtils.cp("../../../../../../#{source}", SharedSourcesDirectoryName)
43
+ end
44
+ end
45
+
46
+ def copy_page_resources(resource_names)
47
+ Dir.mkdir(SharedResourcesDirectoryName) unless Dir.exist?(SharedResourcesDirectoryName)
48
+
49
+ resource_names.each do |resource|
50
+ FileUtils.cp("../../../../../../#{resource}", SharedResourcesDirectoryName)
32
51
  end
33
52
  end
34
53
  end
@@ -2,6 +2,7 @@ require "colored"
2
2
  require "pathname"
3
3
  require "yaml"
4
4
  require "fileutils"
5
+ require "nokogiri"
5
6
  require "renderer/contents_manifest_generator"
6
7
  require "renderer/chapter_collator"
7
8
  require "renderer/page_parser"
@@ -39,17 +40,36 @@ module Playgroundbook
39
40
 
40
41
  book = yaml_contents
41
42
  book_dir_name = "#{book['name']}.playgroundbook"
42
- book_chapter_contents = []
43
+ parsed_chapters = []
43
44
  # TODO: Validate YAML contents?
44
45
  begin
45
- book_chapter_contents = book["chapters"].map do |chapter|
46
- File.read("#{chapter['name']}.playground/Contents.swift")
46
+ parsed_chapters = book["chapters"].map do |chapter|
47
+ source_names = Dir["#{chapter['name']}.playground/Sources/*.swift"]
48
+ resource_names = Dir["#{chapter['name']}.playground/Resources/*"]
49
+ single_page_file = "#{chapter['name']}.playground/Contents.swift"
50
+ if File.exist?(single_page_file)
51
+ c = File.read(single_page_file)
52
+ page_parser.parse_chapter_pages(c, source_names, resource_names)
53
+ elsif !Dir.glob("#{chapter['name']}.playground/Pages/*.xcplaygroundpage").empty?
54
+ toc = Nokogiri::XML(File.read("#{chapter['name']}.playground/contents.xcplayground"))
55
+ page_names = toc.xpath("//page").map { |p| p["name"] }
56
+ pages_data = page_names.map do |p|
57
+ {
58
+ name: p,
59
+ contents: File.read("#{chapter['name']}.playground/Pages/#{p}.xcplaygroundpage/Contents.swift"),
60
+ sources: Dir["#{chapter['name']}.playground/Pages/#{p}.xcplaygroundpage/Sources/*.swift"],
61
+ resources: Dir["#{chapter['name']}.playground/Pages/#{p}.xcplaygroundpage/Resources/*"]
62
+ }
63
+ end
64
+ page_parser.parse_chapter_xcplaygroundpages(pages_data, source_names, resource_names)
65
+ else
66
+ raise "Missing valid playground for #{chapter['name']}."
67
+ end
47
68
  end
48
69
  rescue => e
49
- ui.puts "Failed to open playground Contents.swift file."
70
+ ui.puts "Failed to open and parse playground chapter."
50
71
  raise e
51
72
  end
52
- parsed_chapters = book_chapter_contents.map { |c| page_parser.parse_chapter_pages(c) }
53
73
 
54
74
  book["chapters"].map do |chapter|
55
75
  Dir.glob("Packages/**/Sources/*.swift").each do |file|
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Playgroundbook
2
- VERSION = "0.6.0".freeze
2
+ VERSION = "1.0.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playgroundbook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ash Furrow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-03 00:00:00.000000000 Z
11
+ date: 2017-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plist
@@ -59,19 +59,8 @@ executables:
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - ".gitignore"
63
- - ".rspec"
64
- - ".rubocop.yml"
65
- - ".ruby-version"
66
- - Changelog.md
67
- - CodeOfConduct.md
68
- - Community.md
69
- - Gemfile
70
- - Gemfile.lock
71
- - Guardfile
72
62
  - LICENSE
73
63
  - README.md
74
- - Rakefile
75
64
  - bin/playgroundbook
76
65
  - lib/linter/abstract_linter.rb
77
66
  - lib/linter/chapter_linter.rb
@@ -94,39 +83,6 @@ files:
94
83
  - lib/renderer/playgroundbook_renderer.rb
95
84
  - lib/version.rb
96
85
  - lib/wrapper/markdown_wrapper.rb
97
- - playgroundbook.gemspec
98
- - spec/fixtures/Starter.playgroundbook/Contents/Chapters/Chapter1.playgroundchapter/Manifest.plist
99
- - spec/fixtures/Starter.playgroundbook/Contents/Chapters/Chapter1.playgroundchapter/Pages/Page1.playgroundpage/Contents.swift
100
- - spec/fixtures/Starter.playgroundbook/Contents/Chapters/Chapter1.playgroundchapter/Pages/Page1.playgroundpage/Manifest.plist
101
- - spec/fixtures/Starter.playgroundbook/Contents/Chapters/Chapter1.playgroundchapter/Pages/Page2.playgroundpage/Contents.swift
102
- - spec/fixtures/Starter.playgroundbook/Contents/Chapters/Chapter1.playgroundchapter/Pages/Page2.playgroundpage/Manifest.plist
103
- - spec/fixtures/Starter.playgroundbook/Contents/Manifest.plist
104
- - spec/fixtures/assets/file.jpeg
105
- - spec/fixtures/book.yml
106
- - spec/fixtures/test_chapter.playground/Contents.swift
107
- - spec/fixtures/test_chapter.playground/contents.xcplayground
108
- - spec/fixtures/wrapper/destination/swift_at_artsy_1.swift
109
- - spec/fixtures/wrapper/source/Swift-at-Artsy.playground/Contents.swift
110
- - spec/fixtures/wrapper/source/Swift-at-Artsy.playground/contents.xcplayground
111
- - spec/fixtures/wrapper/source/swift_at_artsy_1.md
112
- - spec/linter/chapter_linter_spec.rb
113
- - spec/linter/chapter_manifest_linter_spec.rb
114
- - spec/linter/contents_linter_spec.rb
115
- - spec/linter/cutscene_page_linter_spec.rb
116
- - spec/linter/cutscene_page_manifest_linter_spec.rb
117
- - spec/linter/manfiest_linter_spec.rb
118
- - spec/linter/page_linter_spec.rb
119
- - spec/linter/page_manifest_linter_spec.rb
120
- - spec/linter/playgroundbook_lint_spec.rb
121
- - spec/linter/root_manifest_linter_spec.rb
122
- - spec/renderer/chapter_collator_spec.rb
123
- - spec/renderer/contents_manfiest_generator_spec.rb
124
- - spec/renderer/glossary_generator_spec.rb
125
- - spec/renderer/page_processor_spec.rb
126
- - spec/renderer/page_writer_spec.rb
127
- - spec/renderer/playgroundbook_renderer_spec.rb
128
- - spec/spec_helper.rb
129
- - spec/wrapper/markdown_wrapper_spec.rb
130
86
  homepage: https://github.com/ashfurrow/playground-book-lint
131
87
  licenses:
132
88
  - MIT
data/.gitignore DELETED
@@ -1,50 +0,0 @@
1
- *.gem
2
- *.rbc
3
- /.config
4
- /coverage/
5
- /InstalledFiles
6
- /pkg/
7
- /spec/reports/
8
- /spec/examples.txt
9
- /test/tmp/
10
- /test/version_tmp/
11
- /tmp/
12
-
13
- # Used by dotenv library to load environment variables.
14
- # .env
15
-
16
- ## Specific to RubyMotion:
17
- .dat*
18
- .repl_history
19
- build/
20
- *.bridgesupport
21
- build-iPhoneOS/
22
- build-iPhoneSimulator/
23
-
24
- ## Specific to RubyMotion (use of CocoaPods):
25
- #
26
- # We recommend against adding the Pods directory to your .gitignore. However
27
- # you should judge for yourself, the pros and cons are mentioned at:
28
- # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29
- #
30
- # vendor/Pods/
31
-
32
- ## Documentation cache and generated files:
33
- /.yardoc/
34
- /_yardoc/
35
- /doc/
36
- /rdoc/
37
-
38
- ## Environment normalization:
39
- /.bundle/
40
- /vendor/bundle
41
- /lib/bundler/man/
42
-
43
- # for a library or gem, you might want to ignore these files since the code is
44
- # intended to run in multiple environments; otherwise, check them in:
45
- # Gemfile.lock
46
- # .ruby-version
47
- # .ruby-gemset
48
-
49
- # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
- .rvmrc
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,112 +0,0 @@
1
- Metrics/LineLength:
2
- Enabled: false
3
-
4
- Style/StringLiterals:
5
- EnforcedStyle: double_quotes
6
- Enabled: true
7
-
8
- # kind_of? is a good way to check a type
9
- Style/ClassCheck:
10
- EnforcedStyle: kind_of?
11
-
12
- # It's better to be more explicit about the type
13
- Style/BracesAroundHashParameters:
14
- Enabled: false
15
-
16
- # specs sometimes have useless assignments, which is fine
17
- Lint/UselessAssignment:
18
- Exclude:
19
- - '**/spec/**/*'
20
-
21
- # We could potentially enable the 2 below:
22
- Style/IndentHash:
23
- Enabled: false
24
-
25
- Style/AlignHash:
26
- Enabled: false
27
-
28
- # HoundCI doesn't like this rule
29
- Style/DotPosition:
30
- Enabled: false
31
-
32
- # We allow !! as it's an easy way to convert ot boolean
33
- Style/DoubleNegation:
34
- Enabled: false
35
-
36
- # Cop supports --auto-correct.
37
- Lint/UnusedBlockArgument:
38
- Enabled: false
39
-
40
- # We want to allow class Fastlane::Class
41
- Style/ClassAndModuleChildren:
42
- Enabled: false
43
-
44
- Metrics/AbcSize:
45
- Max: 60
46
-
47
- # The %w might be confusing for new users
48
- Style/WordArray:
49
- MinSize: 19
50
-
51
- # raise and fail are both okay
52
- Style/SignalException:
53
- Enabled: false
54
-
55
- # Better too much 'return' than one missing
56
- Style/RedundantReturn:
57
- Enabled: false
58
-
59
- # Having if in the same line might not always be good
60
- Style/IfUnlessModifier:
61
- Enabled: false
62
-
63
- # and and or is okay
64
- Style/AndOr:
65
- Enabled: false
66
-
67
- # Configuration parameters: CountComments.
68
- Metrics/ClassLength:
69
- Max: 320
70
-
71
- Metrics/CyclomaticComplexity:
72
- Max: 17
73
-
74
- # Configuration parameters: AllowURI, URISchemes.
75
- Metrics/LineLength:
76
- Max: 370
77
-
78
- # Configuration parameters: CountKeywordArgs.
79
- Metrics/ParameterLists:
80
- Max: 10
81
-
82
- Metrics/PerceivedComplexity:
83
- Max: 18
84
-
85
- # Sometimes it's easier to read without guards
86
- Style/GuardClause:
87
- Enabled: false
88
-
89
- # something = if something_else
90
- # that's confusing
91
- Style/ConditionalAssignment:
92
- Enabled: false
93
-
94
- # Better to have too much self than missing a self
95
- Style/RedundantSelf:
96
- Enabled: false
97
-
98
- Metrics/MethodLength:
99
- Max: 60
100
-
101
- # We're not there yet
102
- Style/Documentation:
103
- Enabled: false
104
-
105
- # Adds complexity
106
- Style/IfInsideElse:
107
- Enabled: false
108
-
109
- # danger specific
110
-
111
- Style/BlockComments:
112
- Enabled: false