diff --git a/.coffeescript-style.json b/.coffeescript-style.json new file mode 100644 index 000000000..c76b419e5 --- /dev/null +++ b/.coffeescript-style.json @@ -0,0 +1,98 @@ +{ + "arrow_spacing": { + "level": "error" + }, + "camel_case_classes": { + "level": "error" + }, + "coffeescript_error": { + "level": "error" + }, + "colon_assignment_spacing": { + "level": "error", + "spacing": { + "left": 0, + "right": 1 + } + }, + "cyclomatic_complexity": { + "level": "ignore", + "value": 10 + }, + "duplicate_key": { + "level": "error" + }, + "empty_constructor_needs_parens": { + "level": "ignore" + }, + "indentation": { + "level": "error", + "value": 2 + }, + "line_endings": { + "level": "ignore", + "value": "unix" + }, + "max_line_length": { + "level": "error", + "value": 80 + }, + "missing_fat_arrows": { + "level": "ignore" + }, + "newlines_after_classes": { + "level": "error", + "value": 1 + }, + "no_backticks": { + "level": "ignore" + }, + "no_debugger": { + "level": "error" + }, + "no_empty_functions": { + "level": "error" + }, + "no_empty_param_list": { + "level": "error" + }, + "no_implicit_braces": { + "level": "ignore" + }, + "no_implicit_parens": { + "level": "ignore" + }, + "no_interpolation_in_single_quotes": { + "level": "error" + }, + "no_plusplus": { + "level": "ignore" + }, + "no_stand_alone_at": { + "level": "error" + }, + "no_tabs": { + "level": "error" + }, + "no_throwing_strings": { + "level": "error" + }, + "no_trailing_semicolons": { + "level": "error" + }, + "no_trailing_whitespace": { + "level": "error" + }, + "no_unnecessary_double_quotes": { + "level": "ignore" + }, + "no_unnecessary_fat_arrows": { + "level": "error" + }, + "non_empty_constructor_needs_parens": { + "level": "ignore" + }, + "space_operators": { + "level": "ignore" + } +} diff --git a/.gitignore b/.gitignore index b8c151c4f..02d1822be 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,9 @@ tmp/* *.toc *~ +# Ignore pdf generated by rails-erd +erd.pdf + # Ignore local configuration files config/settings.local.yml config/settings/*.local.yml diff --git a/.haml-lint.yml b/.haml-lint.yml new file mode 100644 index 000000000..29b0c2780 --- /dev/null +++ b/.haml-lint.yml @@ -0,0 +1,70 @@ +# Whether to ignore frontmatter at the beginning of HAML documents for +# frameworks such as Jekyll/Middleman +skip_frontmatter: false + +linters: + AltText: + enabled: false + + ClassAttributeWithStaticValue: + enabled: true + + ClassesBeforeIds: + enabled: true + + ConsecutiveComments: + enabled: true + + ConsecutiveSilentScripts: + enabled: true + max_consecutive: 2 + + EmptyScript: + enabled: true + + HtmlAttributes: + enabled: true + + ImplicitDiv: + enabled: true + + LeadingCommentSpace: + enabled: true + + LineLength: + enabled: false + max: 80 + + MultilinePipe: + enabled: true + + MultilineScript: + enabled: true + + ObjectReferenceAttributes: + enabled: true + + RuboCop: + enabled: false + + RubyComments: + enabled: true + + SpaceBeforeScript: + enabled: true + + SpaceInsideHashAttributes: + enabled: true + style: space + + TagName: + enabled: true + + TrailingWhitespace: + enabled: true + + UnnecessaryInterpolation: + enabled: true + + UnnecessaryStringOutput: + enabled: true diff --git a/.hound.yml b/.hound.yml index 47f8c2929..60a7a6043 100644 --- a/.hound.yml +++ b/.hound.yml @@ -1,847 +1,17 @@ -AllCops: - Exclude: - - 'test/**/*' - - 'spec/**/*' - - 'features/**/*' - - 'script/**/*' - ShowCopNames: true -# These are all the cops that are enabled in the default configuration. - -Style/AccessModifierIndentation: - Description: Check indentation of private/protected visibility modifiers. - Enabled: true - -Style/AccessorMethodName: - Description: Check the naming of accessor methods for get_/set_. - Enabled: true - -Style/Alias: - Description: 'Use alias_method instead of alias.' - Enabled: true - -Style/AlignArray: - Description: >- - Align the elements of an array literal if they span more than - one line. - Enabled: true - -Style/AlignHash: - Description: >- - Align the elements of a hash literal if they span more than - one line. - Enabled: true - -Style/AlignParameters: - Description: >- - Align the parameters of a method call if they span more - than one line. - Enabled: false - -Style/AndOr: - Description: 'Use &&/|| instead of and/or.' - Enabled: true - -Style/ArrayJoin: - Description: 'Use Array#join instead of Array#*.' - Enabled: true - -Style/AsciiComments: - Description: 'Use only ascii symbols in comments.' - Enabled: true - -Style/AsciiIdentifiers: - Description: 'Use only ascii symbols in identifiers.' - Enabled: true - -Style/Attr: - Description: 'Checks for uses of Module#attr.' - Enabled: true - -Style/BeginBlock: - Description: 'Avoid the use of BEGIN blocks.' - Enabled: true - -Style/BarePercentLiterals: - Description: 'Checks if usage of %() or %Q() matches configuration.' - Enabled: true - -Style/BlockComments: - Description: 'Do not use block comments.' - Enabled: true - -Style/BlockEndNewline: - Description: 'Put end statement of multiline block on its own line.' - Enabled: true - -Style/Blocks: - Description: >- - Avoid using {...} for multi-line blocks (multiline chaining is - always ugly). - Prefer {...} over do...end for single-line blocks. - Enabled: true - -Style/BracesAroundHashParameters: - Description: 'Enforce braces style inside hash parameters.' - Enabled: true - -Style/CaseEquality: - Description: 'Avoid explicit use of the case equality operator(===).' - Enabled: true - -Style/CaseIndentation: - Description: 'Indentation of when in a case/when/[else/]end.' - Enabled: true - -Style/CharacterLiteral: - Description: 'Checks for uses of character literals.' - Enabled: true - -Style/ClassAndModuleCamelCase: - Description: 'Use CamelCase for classes and modules.' - Enabled: true - -Style/ClassAndModuleChildren: - Description: 'Checks style of children classes and modules.' - Enabled: false - -Style/ClassCheck: - Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.' - Enabled: true - -Style/ClassMethods: - Description: 'Use self when defining module/class methods.' - Enabled: true - -Style/ClassVars: - Description: 'Avoid the use of class variables.' - Enabled: true - -Style/CollectionMethods: - Description: 'Preferred collection methods.' - Enabled: true - PreferredMethods: - collect: 'map' - collect!: 'map!' - inject: 'reduce' - detect: 'find' - find_all: 'select' - - -Style/ColonMethodCall: - Description: 'Do not use :: for method call.' - Enabled: true - -Style/CommentAnnotation: - Description: >- - Checks formatting of special comments - (TODO, FIXME, OPTIMIZE, HACK, REVIEW). - Enabled: true - -Style/CommentIndentation: - Description: 'Indentation of comments.' - Enabled: true - -Style/ConstantName: - Description: 'Constants should use SCREAMING_SNAKE_CASE.' - Enabled: true - -Style/DefWithParentheses: - Description: 'Use def with parentheses when there are arguments.' - Enabled: true - -Style/DeprecatedHashMethods: - Description: 'Checks for use of deprecated Hash methods.' - Enabled: true - -Style/Documentation: - Description: 'Document classes and non-namespace modules.' - Enabled: false - -Style/DotPosition: - Description: 'Checks the position of the dot in multi-line method calls.' - Enabled: true - -Style/DoubleNegation: - Description: 'Checks for uses of double negation (!!).' - Enabled: false - -Style/EachWithObject: - Description: 'Prefer `each_with_object` over `inject` or `reduce`.' - Enabled: false - -Style/EmptyLineBetweenDefs: - Description: 'Use empty lines between defs.' - Enabled: true - -Style/EmptyLines: - Description: "Don't use several empty lines in a row." - Enabled: true - -Style/EmptyLinesAroundAccessModifier: - Description: "Keep blank lines around access modifiers." - Enabled: false - -Style/EmptyLinesAroundBody: - Description: "Keeps track of empty lines around expression bodies." - Enabled: true - -Style/EmptyLiteral: - Description: 'Prefer literals to Array.new/Hash.new/String.new.' - Enabled: true - -Style/Encoding: - Description: 'Use UTF-8 as the source file encoding.' - Enabled: true - -Style/EndBlock: - Description: 'Avoid the use of END blocks.' - Enabled: true - -Style/EndOfLine: - Description: 'Use Unix-style line endings.' - Enabled: true - -Style/EvenOdd: - Description: 'Favor the use of Fixnum#even? && Fixnum#odd?' - Enabled: true - -Style/FileName: - Description: 'Use snake_case for source file names.' - Enabled: false - Exclude: - - 'db/**/*' - -Style/FlipFlop: - Description: 'Checks for flip flops' - Enabled: true - -Style/For: - Description: 'Checks use of for or each in multiline loops.' - Enabled: true - -Style/FormatString: - Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.' - Enabled: true - -Style/GlobalVars: - Description: 'Do not introduce global variables.' - Enabled: true - -Style/GuardClause: - Description: 'Check for conditionals that can be replaced with guard clauses' - Enabled: false - -Style/HashSyntax: - Description: >- - Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax - { :a => 1, :b => 2 }. - Enabled: true - -Style/IfUnlessModifier: - Description: >- - Favor modifier if/unless usage when you have a - single-line body. - Enabled: true - -Style/IfWithSemicolon: - Description: 'Never use if x; .... Use the ternary operator instead.' - Enabled: true - -Style/IndentationConsistency: - Description: 'Keep indentation straight.' - Enabled: true - -Style/IndentationWidth: - Description: 'Use 2 spaces for indentation.' - Enabled: true - -Style/IndentArray: - Description: >- - Checks the indentation of the first element in an array - literal. - Enabled: true - -Style/IndentHash: - Description: 'Checks the indentation of the first key in a hash literal.' - Enabled: false - -Style/Lambda: - Description: 'Use the new lambda literal syntax for single-line blocks.' - Enabled: false - -Style/LambdaCall: - Description: 'Use lambda.call(...) instead of lambda.(...).' - Enabled: true - -Style/LeadingCommentSpace: - Description: 'Comments should start with a space.' - Enabled: true - -Style/LineEndConcatenation: - Description: >- - Use \ instead of + or << to concatenate two string literals at - line end. - Enabled: true - -Style/MethodCallParentheses: - Description: 'Do not use parentheses for method calls with no arguments.' - Enabled: true - -Style/MethodDefParentheses: - Description: >- - Checks if the method definitions have or don't have - parentheses. - Enabled: true - -Style/MethodName: - Description: 'Use the configured style when naming methods.' - Enabled: true - -Style/ModuleFunction: - Description: 'Checks for usage of `extend self` in modules.' - Enabled: true - -Style/MultilineBlockChain: - Description: 'Avoid multi-line chains of blocks.' - Enabled: true - -Style/MultilineBlockLayout: - Description: 'Ensures newlines after multiline block do statements.' - Enabled: true - -Style/MultilineIfThen: - Description: 'Never use then for multi-line if/unless.' - Enabled: true - -Style/MultilineTernaryOperator: - Description: >- - Avoid multi-line ?: (the ternary operator); - use if/unless instead. - Enabled: true - -Style/NegatedIf: - Description: >- - Favor unless over if for negative conditions - (or control flow or). - Enabled: true - -Style/NegatedWhile: - Description: 'Favor until over while for negative conditions.' - Enabled: true - -Style/NestedTernaryOperator: - Description: 'Use one expression per branch in a ternary operator.' - Enabled: true - -Style/Next: - Description: 'Use `next` to skip iteration instead of a condition at the end.' - Enabled: true - -Style/NilComparison: - Description: 'Prefer x.nil? to x == nil.' - Enabled: true - -Style/NonNilCheck: - Description: 'Checks for redundant nil checks.' - Enabled: true - -Style/Not: - Description: 'Use ! instead of not.' - Enabled: true - -Style/NumericLiterals: - Description: >- - Add underscores to large numeric literals to improve their - readability. - Enabled: true - -Style/OneLineConditional: - Description: >- - Favor the ternary operator(?:) over - if/then/else/end constructs. - Enabled: true - -Style/OpMethod: - Description: 'When defining binary operators, name the argument other.' - Enabled: true - -Style/ParenthesesAroundCondition: - Description: >- - Don't use parentheses around the condition of an - if/unless/while. - Enabled: true - -Style/PercentLiteralDelimiters: - Description: 'Use `%`-literal delimiters consistently' - Enabled: true - -Style/PercentQLiterals: - Description: 'Checks if uses of %Q/%q match the configured preference.' - Enabled: true - -Style/PerlBackrefs: - Description: 'Avoid Perl-style regex back references.' - Enabled: true - -Style/PredicateName: - Description: 'Check the names of predicate methods.' - Enabled: true - -Style/Proc: - Description: 'Use proc instead of Proc.new.' - Enabled: true - -Style/RaiseArgs: - Description: 'Checks the arguments passed to raise/fail.' - Enabled: false - -Style/RedundantBegin: - Description: "Don't use begin blocks when they are not needed." - Enabled: true - -Style/RedundantException: - Description: "Checks for an obsolete RuntimeException argument in raise/fail." - Enabled: true - -Style/RedundantReturn: - Description: "Don't use return where it's not required." - Enabled: true - -Style/RedundantSelf: - Description: "Don't use self where it's not needed." - Enabled: true - -Style/RegexpLiteral: - Description: >- - Use %r for regular expressions matching more than - `MaxSlashes` '/' characters. - Use %r only for regular expressions matching more than - `MaxSlashes` '/' character. - Enabled: false - -Style/RescueModifier: - Description: 'Avoid using rescue in its modifier form.' - Enabled: true - -Style/SelfAssignment: - Description: >- - Checks for places where self-assignment shorthand should have - been used. - Enabled: true - -Style/Semicolon: - Description: "Don't use semicolons to terminate expressions." - Enabled: true - -Style/SignalException: - Description: 'Checks for proper usage of fail and raise.' - Enabled: false - -Style/SingleLineBlockParams: - Description: 'Enforces the names of some block params.' - Enabled: true - -Style/SingleLineMethods: - Description: 'Avoid single-line methods.' - Enabled: true - -Style/SingleSpaceBeforeFirstArg: - Description: >- - Checks that exactly one space is used between a method name - and the first argument for method calls without parentheses. - Enabled: true - -Style/SpaceAfterColon: - Description: 'Use spaces after colons.' - Enabled: true - -Style/SpaceAfterComma: - Description: 'Use spaces after commas.' - Enabled: true - -Style/SpaceAfterControlKeyword: - Description: 'Use spaces after if/elsif/unless/while/until/case/when.' - Enabled: true - -Style/SpaceAfterMethodName: - Description: >- - Never put a space between a method name and the opening - parenthesis in a method definition. - Enabled: true - -Style/SpaceAfterNot: - Description: Tracks redundant space after the ! operator. - Enabled: true - -Style/SpaceAfterSemicolon: - Description: 'Use spaces after semicolons.' - Enabled: true - -Style/SpaceBeforeBlockBraces: - Description: >- - Checks that the left block brace has or doesn't have space - before it. - Enabled: true - -Style/SpaceBeforeComma: - Description: 'No spaces before commas.' - Enabled: true - -Style/SpaceBeforeComment: - Description: >- - Checks for missing space between code and a comment on the - same line. - Enabled: true - -Style/SpaceBeforeSemicolon: - Description: 'No spaces before semicolons.' - Enabled: true - -Style/SpaceInsideBlockBraces: - Description: >- - Checks that block braces have or don't have surrounding space. - For blocks taking parameters, checks that the left brace has - or doesn't have trailing space. - Enabled: true - -Style/SpaceAroundEqualsInParameterDefault: - Description: >- - Checks that the equals signs in parameter default assignments - have or don't have surrounding space depending on - configuration. - Enabled: true - -Style/SpaceAroundOperators: - Description: 'Use spaces around operators.' - Enabled: true - -Style/SpaceBeforeModifierKeyword: - Description: 'Put a space before the modifier keyword.' - Enabled: true - -Style/SpaceInsideBrackets: - Description: 'No spaces after [ or before ].' - Enabled: true - -Style/SpaceInsideHashLiteralBraces: - Description: "Use spaces inside hash literal braces - or don't." - Enabled: true - EnforcedStyle: no_space - -Style/SpaceInsideParens: - Description: 'No spaces after ( or before ).' - Enabled: true - -Style/SpecialGlobalVars: - Description: 'Avoid Perl-style global variables.' - Enabled: true - -Style/StringLiterals: - Description: 'Checks if uses of quotes match the configured preference.' - Enabled: true - Style: 'single_quotes' - EnforcedStyle: single_quotes - -Style/Tab: - Description: 'No hard tabs.' - Enabled: true - -Style/TrailingBlankLines: - Description: 'Checks trailing blank lines and final newline.' - Enabled: true - -Style/TrailingComma: - EnforcedStyleForMultiline: comma - Description: 'Checks for trailing comma in parameter lists and literals.' - Enabled: true - -Style/TrailingWhitespace: - Description: 'Avoid trailing whitespace.' - Enabled: true - -Style/TrivialAccessors: - Description: 'Prefer attr_* methods to trivial readers/writers.' - Enabled: true - -Style/UnlessElse: - Description: >- - Never use unless with else. Rewrite these with the positive - case first. - Enabled: true - -Style/UnneededCapitalW: - Description: 'Checks for %W when interpolation is not needed.' - Enabled: true - -Style/UnneededPercentQ: - Description: 'Checks for %q/%Q when single quotes or double quotes would do.' - Enabled: true - -Style/UnneededPercentX: - Description: 'Checks for %x when `` would do.' - Enabled: true - -Style/VariableInterpolation: - Description: >- - Don't interpolate global, instance and class variables - directly in strings. - Enabled: true - -Style/VariableName: - Description: 'Use the configured style when naming variables.' - Enabled: true - -Style/WhenThen: - Description: 'Use when x then ... for one-line cases.' - Enabled: true - -Style/WhileUntilDo: - Description: 'Checks for redundant do after while or until.' - Enabled: true - -Style/WhileUntilModifier: - Description: >- - Favor modifier while/until usage when you have a - single-line body. - Enabled: true - -Style/WordArray: - Description: 'Use %w or %W for arrays of words.' - Enabled: true - -#################### Metrics ################################ - -Metrics/BlockNesting: - Description: 'Avoid excessive block nesting' - Enabled: true - -Metrics/ClassLength: - Description: 'Avoid classes longer than 100 lines of code.' - Enabled: true - -Metrics/CyclomaticComplexity: - Description: >- - A complexity metric that is strongy correlated to the number - of test cases needed to validate a method. - Enabled: true - -Metrics/LineLength: - Description: 'Limit lines to 80 characters.' - Enabled: true - -Metrics/MethodLength: - Description: 'Avoid methods longer than 10 lines of code.' - Enabled: true - -Metrics/ParameterLists: - Description: 'Avoid parameter lists longer than three or four parameters.' - Enabled: true - -Metrics/PerceivedComplexity: - Description: >- - A complexity metric geared towards measuring complexity for a - human reader. - Enabled: true - -#################### Lint ################################ -### Warnings - -Lint/AmbiguousOperator: - Description: >- - Checks for ambiguous operators in the first argument of a - method invocation without parentheses. - Enabled: true - -Lint/AmbiguousRegexpLiteral: - Description: >- - Checks for ambiguous regexp literals in the first argument of - a method invocation without parenthesis. - Enabled: true - -Lint/AssignmentInCondition: - Description: "Don't use assignment in conditions." - Enabled: false - -Lint/BlockAlignment: - Description: 'Align block ends correctly.' - Enabled: true - -Lint/ConditionPosition: - Description: >- - Checks for condition placed in a confusing position relative to - the keyword. - Enabled: true - -Lint/Debugger: - Description: 'Check for debugger calls.' - Enabled: true - -Lint/DefEndAlignment: - Description: 'Align ends corresponding to defs correctly.' - Enabled: true - -Lint/DeprecatedClassMethods: - Description: 'Check for deprecated class method calls.' - Enabled: true - -Lint/ElseLayout: - Description: 'Check for odd code arrangement in an else block.' - Enabled: true - -Lint/EmptyEnsure: - Description: 'Checks for empty ensure block.' - Enabled: true - -Lint/EmptyInterpolation: - Description: 'Checks for empty string interpolation.' - Enabled: true - -Lint/EndAlignment: - Description: 'Align ends correctly.' - Enabled: true - -Lint/EndInMethod: - Description: 'END blocks should not be placed inside method definitions.' - Enabled: true - -Lint/EnsureReturn: - Description: 'Never use return in an ensure block.' - Enabled: true - -Lint/Eval: - Description: 'The use of eval represents a serious security risk.' - Enabled: true - -Lint/HandleExceptions: - Description: "Don't suppress exception." - Enabled: true - -Lint/InvalidCharacterLiteral: - Description: >- - Checks for invalid character literals with a non-escaped - whitespace character. - Enabled: true - -Lint/LiteralInCondition: - Description: 'Checks of literals used in conditions.' - Enabled: true - -Lint/LiteralInInterpolation: - Description: 'Checks for literals used in interpolation.' - Enabled: true - -Lint/Loop: - Description: >- - Use Kernel#loop with break rather than begin/end/until or - begin/end/while for post-loop tests. - Enabled: true - -Lint/ParenthesesAsGroupedExpression: - Description: >- - Checks for method calls with a space before the opening - parenthesis. - Enabled: true - -Lint/RequireParentheses: - Description: >- - Use parentheses in the method call to avoid confusion - about precedence. - Enabled: true - -Lint/RescueException: - Description: 'Avoid rescuing the Exception class.' - Enabled: true - -Lint/ShadowingOuterLocalVariable: - Description: >- - Do not use the same name as outer local variable - for block arguments or block local variables. - Enabled: true - -Lint/SpaceBeforeFirstArg: - Description: >- - Put a space between a method name and the first argument - in a method call without parentheses. - Enabled: true - -Lint/StringConversionInInterpolation: - Description: 'Checks for Object#to_s usage in string interpolation.' - Enabled: true - -Lint/UnderscorePrefixedVariableName: - Description: 'Do not use prefix `_` for a variable that is used.' - Enabled: true - -Lint/UnusedBlockArgument: - Description: 'Checks for unused block arguments.' - Enabled: true - -Lint/UnusedMethodArgument: - Description: 'Checks for unused method arguments.' - Enabled: true - -Lint/UnreachableCode: - Description: 'Unreachable code.' - Enabled: true - -Lint/UselessAccessModifier: - Description: 'Checks for useless access modifiers.' - Enabled: true - -Lint/UselessAssignment: - Description: 'Checks for useless assignment to a local variable.' - Enabled: true - -Lint/UselessComparison: - Description: 'Checks for comparison of something with itself.' - Enabled: true - -Lint/UselessElseWithoutRescue: - Description: 'Checks for useless `else` in `begin..end` without `rescue`.' - Enabled: true - -Lint/UselessSetterCall: - Description: 'Checks for useless setter call to a local variable.' - Enabled: true - -Lint/Void: - Description: 'Possible use of operator/literal/variable in void context.' - Enabled: true - -##################### Rails ################################## - -Rails/ActionFilter: - Description: 'Enforces consistent use of action filter methods.' - Enabled: false - -Rails/DefaultScope: - Description: 'Checks if the argument passed to default_scope is a block.' - Enabled: true - -Rails/Delegate: - Description: 'Prefer delegate method for delegations.' - Enabled: true - -Rails/HasAndBelongsToMany: - Description: 'Prefer has_many :through to has_and_belongs_to_many.' - Enabled: false - -Rails/Output: - Description: 'Checks for calls to puts, print, etc.' - Enabled: true +ruby: + enabled: true + config_file: .rubocop.yml -Rails/ReadWriteAttribute: - Description: >- - Checks for read_attribute(:attr) and - write_attribute(:attr, val). - Enabled: true +haml: + enabled: true + config_file: .haml-lint.yml -Rails/ScopeArgs: - Description: 'Checks the arguments of ActiveRecord scopes.' - Enabled: true +coffeescript: + enabled: true + config_file: .coffeescript-style.json -Rails/Validation: - Description: 'Use sexy validations.' - Enabled: true +javascript: + enabled: true + config_file: .javascript-style.json diff --git a/.javascript-style.json b/.javascript-style.json new file mode 100644 index 000000000..27d04f122 --- /dev/null +++ b/.javascript-style.json @@ -0,0 +1,33 @@ +{ + "asi": false, + "bitwise": true, + "browser": true, + "camelcase": true, + "curly": true, + "forin": true, + "immed": true, + "latedef": "nofunc", + "maxlen": 80, + "newcap": true, + "noarg": true, + "noempty": true, + "nonew": true, + "predef": [ + "$", + "jQuery", + + "jasmine", + "beforeEach", + "describe", + "expect", + "it", + + "angular", + "inject", + "module" + ], + "quotmark": true, + "trailing": true, + "undef": true, + "unused": true +} diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 000000000..f043b2d95 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,854 @@ +AllCops: + Exclude: + - 'test/**/*' + - 'spec/**/*' + - 'features/**/*' + - 'script/**/*' + TargetRubyVersion: 2.1 + +# These are all the cops that are enabled in the default configuration. + +Style/AccessModifierIndentation: + Description: Check indentation of private/protected visibility modifiers. + Enabled: true + +Style/AccessorMethodName: + Description: Check the naming of accessor methods for get_/set_. + Enabled: true + +Style/Alias: + Description: 'Use alias_method instead of alias.' + Enabled: true + +Style/AlignArray: + Description: >- + Align the elements of an array literal if they span more than + one line. + Enabled: true + +Style/AlignHash: + Description: >- + Align the elements of a hash literal if they span more than + one line. + Enabled: true + +Style/AlignParameters: + Description: >- + Align the parameters of a method call if they span more + than one line. + Enabled: false + +Style/AndOr: + Description: 'Use &&/|| instead of and/or.' + Enabled: true + +Style/ArrayJoin: + Description: 'Use Array#join instead of Array#*.' + Enabled: true + +Style/AsciiComments: + Description: 'Use only ascii symbols in comments.' + Enabled: true + +Style/AsciiIdentifiers: + Description: 'Use only ascii symbols in identifiers.' + Enabled: true + +Style/Attr: + Description: 'Checks for uses of Module#attr.' + Enabled: true + +Style/BeginBlock: + Description: 'Avoid the use of BEGIN blocks.' + Enabled: true + +Style/BarePercentLiterals: + Description: 'Checks if usage of %() or %Q() matches configuration.' + Enabled: true + +Style/BlockComments: + Description: 'Do not use block comments.' + Enabled: true + +Style/BlockEndNewline: + Description: 'Put end statement of multiline block on its own line.' + Enabled: true + +Style/BlockDelimiters: + Description: >- + Avoid using {...} for multi-line blocks (multiline chaining is + always ugly). + Prefer {...} over do...end for single-line blocks. + Enabled: true + +Style/BracesAroundHashParameters: + Description: 'Enforce braces style inside hash parameters.' + Enabled: true + +Style/CaseEquality: + Description: 'Avoid explicit use of the case equality operator(===).' + Enabled: true + +Style/CaseIndentation: + Description: 'Indentation of when in a case/when/[else/]end.' + Enabled: true + +Style/CharacterLiteral: + Description: 'Checks for uses of character literals.' + Enabled: true + +Style/ClassAndModuleCamelCase: + Description: 'Use CamelCase for classes and modules.' + Enabled: true + +Style/ClassAndModuleChildren: + Description: 'Checks style of children classes and modules.' + Enabled: false + +Style/ClassCheck: + Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.' + Enabled: true + +Style/ClassMethods: + Description: 'Use self when defining module/class methods.' + Enabled: true + +Style/ClassVars: + Description: 'Avoid the use of class variables.' + Enabled: true + +Style/CollectionMethods: + Description: 'Preferred collection methods.' + Enabled: true + PreferredMethods: + collect: 'map' + collect!: 'map!' + inject: 'reduce' + detect: 'find' + find_all: 'select' + + +Style/ColonMethodCall: + Description: 'Do not use :: for method call.' + Enabled: true + +Style/CommentAnnotation: + Description: >- + Checks formatting of special comments + (TODO, FIXME, OPTIMIZE, HACK, REVIEW). + Enabled: true + +Style/CommentIndentation: + Description: 'Indentation of comments.' + Enabled: true + +Style/ConstantName: + Description: 'Constants should use SCREAMING_SNAKE_CASE.' + Enabled: true + +Style/DefWithParentheses: + Description: 'Use def with parentheses when there are arguments.' + Enabled: true + +Style/DeprecatedHashMethods: + Description: 'Checks for use of deprecated Hash methods.' + Enabled: true + +Style/Documentation: + Description: 'Document classes and non-namespace modules.' + Enabled: false + +Style/DotPosition: + Description: 'Checks the position of the dot in multi-line method calls.' + EnforcedStyle: trailing + Enabled: true + +Style/DoubleNegation: + Description: 'Checks for uses of double negation (!!).' + Enabled: false + +Style/EachWithObject: + Description: 'Prefer `each_with_object` over `inject` or `reduce`.' + Enabled: false + +Style/EmptyLineBetweenDefs: + Description: 'Use empty lines between defs.' + Enabled: true + +Style/EmptyLines: + Description: "Don't use several empty lines in a row." + Enabled: true + +Style/EmptyLinesAroundAccessModifier: + Description: "Keep blank lines around access modifiers." + Enabled: false + +Style/EmptyLinesAroundBlockBody: + Description: "Keeps track of empty lines around block bodies." + Enabled: true + +Style/EmptyLinesAroundClassBody: + Description: "Keeps track of empty lines around class bodies." + Enabled: true + +Style/EmptyLinesAroundModuleBody: + Description: "Keeps track of empty lines around module bodies." + Enabled: true + +Style/EmptyLinesAroundMethodBody: + Description: "Keeps track of empty lines around method bodies." + Enabled: true + +Style/EmptyLiteral: + Description: 'Prefer literals to Array.new/Hash.new/String.new.' + Enabled: true + +Style/Encoding: + Description: 'Use UTF-8 as the source file encoding.' + EnforcedStyle: when_needed + Enabled: true + +Style/EndBlock: + Description: 'Avoid the use of END blocks.' + Enabled: true + +Style/EndOfLine: + Description: 'Use Unix-style line endings.' + Enabled: true + +Style/EvenOdd: + Description: 'Favor the use of Fixnum#even? && Fixnum#odd?' + Enabled: true + +Style/FileName: + Description: 'Use snake_case for source file names.' + Enabled: false + Exclude: + - 'db/**/*' + +Style/FlipFlop: + Description: 'Checks for flip flops' + Enabled: true + +Style/For: + Description: 'Checks use of for or each in multiline loops.' + Enabled: true + +Style/FormatString: + Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.' + Enabled: true + +Style/GlobalVars: + Description: 'Do not introduce global variables.' + Enabled: true + +Style/GuardClause: + Description: 'Check for conditionals that can be replaced with guard clauses' + Enabled: false + +Style/HashSyntax: + Description: >- + Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax + { :a => 1, :b => 2 }. + Enabled: true + +Style/IfUnlessModifier: + Description: >- + Favor modifier if/unless usage when you have a + single-line body. + Enabled: true + +Style/IfWithSemicolon: + Description: 'Never use if x; .... Use the ternary operator instead.' + Enabled: true + +Style/IndentationConsistency: + Description: 'Keep indentation straight.' + Enabled: true + +Style/IndentationWidth: + Description: 'Use 2 spaces for indentation.' + Enabled: true + +Style/IndentArray: + Description: >- + Checks the indentation of the first element in an array + literal. + Enabled: true + +Style/IndentHash: + Description: 'Checks the indentation of the first key in a hash literal.' + Enabled: false + +Style/Lambda: + Description: 'Use the new lambda literal syntax for single-line blocks.' + Enabled: false + +Style/LambdaCall: + Description: 'Use lambda.call(...) instead of lambda.(...).' + Enabled: true + +Style/LeadingCommentSpace: + Description: 'Comments should start with a space.' + Enabled: true + +Style/LineEndConcatenation: + Description: >- + Use \ instead of + or << to concatenate two string literals at + line end. + Enabled: true + +Style/MethodCallParentheses: + Description: 'Do not use parentheses for method calls with no arguments.' + Enabled: true + +Style/MethodDefParentheses: + Description: >- + Checks if the method definitions have or don't have + parentheses. + Enabled: true + +Style/MethodName: + Description: 'Use the configured style when naming methods.' + Enabled: true + +Style/ModuleFunction: + Description: 'Checks for usage of `extend self` in modules.' + Enabled: true + +Style/MultilineBlockChain: + Description: 'Avoid multi-line chains of blocks.' + Enabled: true + +Style/MultilineBlockLayout: + Description: 'Ensures newlines after multiline block do statements.' + Enabled: true + +Style/MultilineIfThen: + Description: 'Never use then for multi-line if/unless.' + Enabled: true + +Style/MultilineTernaryOperator: + Description: >- + Avoid multi-line ?: (the ternary operator); + use if/unless instead. + Enabled: true + +Style/MultilineMethodCallIndentation: + EnforcedStyle: indented + Enabled: true + +Style/NegatedIf: + Description: >- + Favor unless over if for negative conditions + (or control flow or). + Enabled: true + +Style/NegatedWhile: + Description: 'Favor until over while for negative conditions.' + Enabled: true + +Style/NestedTernaryOperator: + Description: 'Use one expression per branch in a ternary operator.' + Enabled: true + +Style/Next: + Description: 'Use `next` to skip iteration instead of a condition at the end.' + Enabled: true + +Style/NilComparison: + Description: 'Prefer x.nil? to x == nil.' + Enabled: true + +Style/NonNilCheck: + Description: 'Checks for redundant nil checks.' + Enabled: true + +Style/Not: + Description: 'Use ! instead of not.' + Enabled: true + +Style/NumericLiterals: + Description: >- + Add underscores to large numeric literals to improve their + readability. + Enabled: true + +Style/OneLineConditional: + Description: >- + Favor the ternary operator(?:) over + if/then/else/end constructs. + Enabled: true + +Style/OpMethod: + Description: 'When defining binary operators, name the argument other.' + Enabled: true + +Style/ParenthesesAroundCondition: + Description: >- + Don't use parentheses around the condition of an + if/unless/while. + Enabled: true + +Style/PercentLiteralDelimiters: + Description: 'Use `%`-literal delimiters consistently' + Enabled: true + +Style/PercentQLiterals: + Description: 'Checks if uses of %Q/%q match the configured preference.' + Enabled: true + +Style/PerlBackrefs: + Description: 'Avoid Perl-style regex back references.' + Enabled: true + +Style/PredicateName: + Description: 'Check the names of predicate methods.' + Enabled: true + +Style/Proc: + Description: 'Use proc instead of Proc.new.' + Enabled: true + +Style/RaiseArgs: + Description: 'Checks the arguments passed to raise/fail.' + Enabled: false + +Style/RedundantBegin: + Description: "Don't use begin blocks when they are not needed." + Enabled: true + +Style/RedundantException: + Description: "Checks for an obsolete RuntimeException argument in raise/fail." + Enabled: true + +Style/RedundantReturn: + Description: "Don't use return where it's not required." + Enabled: true + +Style/RedundantSelf: + Description: "Don't use self where it's not needed." + Enabled: true + +Style/RegexpLiteral: + Description: >- + Use %r for regular expressions matching more than + `MaxSlashes` '/' characters. + Use %r only for regular expressions matching more than + `MaxSlashes` '/' character. + Enabled: false + +Style/RescueModifier: + Description: 'Avoid using rescue in its modifier form.' + Enabled: true + +Style/SelfAssignment: + Description: >- + Checks for places where self-assignment shorthand should have + been used. + Enabled: true + +Style/Semicolon: + Description: "Don't use semicolons to terminate expressions." + Enabled: true + +Style/SignalException: + Description: 'Checks for proper usage of fail and raise.' + Enabled: false + +Style/SingleLineBlockParams: + Description: 'Enforces the names of some block params.' + Enabled: true + +Style/SingleLineMethods: + Description: 'Avoid single-line methods.' + Enabled: true + +Style/SpaceBeforeFirstArg: + Description: >- + Checks that exactly one space is used between a method name + and the first argument for method calls without parentheses. + Enabled: true + +Style/SpaceAfterColon: + Description: 'Use spaces after colons.' + Enabled: true + +Style/SpaceAfterComma: + Description: 'Use spaces after commas.' + Enabled: true + +Style/SpaceAfterControlKeyword: + Description: 'Use spaces after if/elsif/unless/while/until/case/when.' + Enabled: true + +Style/SpaceAfterMethodName: + Description: >- + Never put a space between a method name and the opening + parenthesis in a method definition. + Enabled: true + +Style/SpaceAfterNot: + Description: Tracks redundant space after the ! operator. + Enabled: true + +Style/SpaceAfterSemicolon: + Description: 'Use spaces after semicolons.' + Enabled: true + +Style/SpaceBeforeBlockBraces: + Description: >- + Checks that the left block brace has or doesn't have space + before it. + Enabled: true + +Style/SpaceBeforeComma: + Description: 'No spaces before commas.' + Enabled: true + +Style/SpaceBeforeComment: + Description: >- + Checks for missing space between code and a comment on the + same line. + Enabled: true + +Style/SpaceBeforeSemicolon: + Description: 'No spaces before semicolons.' + Enabled: true + +Style/SpaceInsideBlockBraces: + Description: >- + Checks that block braces have or don't have surrounding space. + For blocks taking parameters, checks that the left brace has + or doesn't have trailing space. + Enabled: true + +Style/SpaceAroundEqualsInParameterDefault: + Description: >- + Checks that the equals signs in parameter default assignments + have or don't have surrounding space depending on + configuration. + Enabled: true + +Style/SpaceAroundOperators: + Description: 'Use spaces around operators.' + Enabled: true + +Style/SpaceBeforeModifierKeyword: + Description: 'Put a space before the modifier keyword.' + Enabled: true + +Style/SpaceInsideBrackets: + Description: 'No spaces after [ or before ].' + Enabled: true + +Style/SpaceInsideHashLiteralBraces: + Description: "Use spaces inside hash literal braces - or don't." + Enabled: true + EnforcedStyle: no_space + +Style/SpaceInsideParens: + Description: 'No spaces after ( or before ).' + Enabled: true + +Style/SpecialGlobalVars: + Description: 'Avoid Perl-style global variables.' + Enabled: true + +Style/StringLiterals: + Description: 'Checks if uses of quotes match the configured preference.' + Enabled: true + EnforcedStyle: single_quotes + +Style/Tab: + Description: 'No hard tabs.' + Enabled: true + +Style/TrailingBlankLines: + Description: 'Checks trailing blank lines and final newline.' + Enabled: true + +Style/TrailingCommaInArguments: + EnforcedStyleForMultiline: comma + Description: 'Checks for trailing comma in argument lists.' + Enabled: true + +Style/TrailingCommaInLiteral: + EnforcedStyleForMultiline: comma + Description: 'Checks for trailing comma in array and hash literals.' + Enabled: true + +Style/TrailingWhitespace: + Description: 'Avoid trailing whitespace.' + Enabled: true + +Style/TrivialAccessors: + Description: 'Prefer attr_* methods to trivial readers/writers.' + Enabled: true + +Style/UnlessElse: + Description: >- + Never use unless with else. Rewrite these with the positive + case first. + Enabled: true + +Style/UnneededCapitalW: + Description: 'Checks for %W when interpolation is not needed.' + Enabled: true + +Style/UnneededPercentQ: + Description: 'Checks for %q/%Q when single quotes or double quotes would do.' + Enabled: true + +Style/VariableInterpolation: + Description: >- + Don't interpolate global, instance and class variables + directly in strings. + Enabled: true + +Style/VariableName: + Description: 'Use the configured style when naming variables.' + Enabled: true + +Style/WhenThen: + Description: 'Use when x then ... for one-line cases.' + Enabled: true + +Style/WhileUntilDo: + Description: 'Checks for redundant do after while or until.' + Enabled: true + +Style/WhileUntilModifier: + Description: >- + Favor modifier while/until usage when you have a + single-line body. + Enabled: true + +Style/WordArray: + Description: 'Use %w or %W for arrays of words.' + Enabled: true + +#################### Metrics ################################ + +Metrics/BlockNesting: + Description: 'Avoid excessive block nesting' + Enabled: true + +Metrics/ClassLength: + Description: 'Avoid classes longer than 100 lines of code.' + Enabled: true + +Metrics/CyclomaticComplexity: + Description: >- + A complexity metric that is strongy correlated to the number + of test cases needed to validate a method. + Enabled: true + +Metrics/LineLength: + Description: 'Limit lines to 80 characters.' + Enabled: true + +Metrics/MethodLength: + Description: 'Avoid methods longer than 10 lines of code.' + Enabled: true + +Metrics/ParameterLists: + Description: 'Avoid parameter lists longer than three or four parameters.' + Enabled: true + +Metrics/PerceivedComplexity: + Description: >- + A complexity metric geared towards measuring complexity for a + human reader. + Enabled: true + +#################### Lint ################################ +### Warnings + +Lint/AmbiguousOperator: + Description: >- + Checks for ambiguous operators in the first argument of a + method invocation without parentheses. + Enabled: true + +Lint/AmbiguousRegexpLiteral: + Description: >- + Checks for ambiguous regexp literals in the first argument of + a method invocation without parenthesis. + Enabled: true + +Lint/AssignmentInCondition: + Description: "Don't use assignment in conditions." + Enabled: false + +Lint/BlockAlignment: + Description: 'Align block ends correctly.' + Enabled: true + +Lint/ConditionPosition: + Description: >- + Checks for condition placed in a confusing position relative to + the keyword. + Enabled: true + +Lint/Debugger: + Description: 'Check for debugger calls.' + Enabled: true + +Lint/DefEndAlignment: + Description: 'Align ends corresponding to defs correctly.' + Enabled: true + +Lint/DeprecatedClassMethods: + Description: 'Check for deprecated class method calls.' + Enabled: true + +Lint/ElseLayout: + Description: 'Check for odd code arrangement in an else block.' + Enabled: true + +Lint/EmptyEnsure: + Description: 'Checks for empty ensure block.' + Enabled: true + +Lint/EmptyInterpolation: + Description: 'Checks for empty string interpolation.' + Enabled: true + +Lint/EndAlignment: + Description: 'Align ends correctly.' + Enabled: true + +Lint/EndInMethod: + Description: 'END blocks should not be placed inside method definitions.' + Enabled: true + +Lint/EnsureReturn: + Description: 'Never use return in an ensure block.' + Enabled: true + +Lint/Eval: + Description: 'The use of eval represents a serious security risk.' + Enabled: true + +Lint/HandleExceptions: + Description: "Don't suppress exception." + Enabled: true + +Lint/InvalidCharacterLiteral: + Description: >- + Checks for invalid character literals with a non-escaped + whitespace character. + Enabled: true + +Lint/LiteralInCondition: + Description: 'Checks of literals used in conditions.' + Enabled: true + +Lint/LiteralInInterpolation: + Description: 'Checks for literals used in interpolation.' + Enabled: true + +Lint/Loop: + Description: >- + Use Kernel#loop with break rather than begin/end/until or + begin/end/while for post-loop tests. + Enabled: true + +Lint/ParenthesesAsGroupedExpression: + Description: >- + Checks for method calls with a space before the opening + parenthesis. + Enabled: true + +Lint/RequireParentheses: + Description: >- + Use parentheses in the method call to avoid confusion + about precedence. + Enabled: true + +Lint/RescueException: + Description: 'Avoid rescuing the Exception class.' + Enabled: true + +Lint/ShadowingOuterLocalVariable: + Description: >- + Do not use the same name as outer local variable + for block arguments or block local variables. + Enabled: true + +Lint/StringConversionInInterpolation: + Description: 'Checks for Object#to_s usage in string interpolation.' + Enabled: true + +Lint/UnderscorePrefixedVariableName: + Description: 'Do not use prefix `_` for a variable that is used.' + Enabled: true + +Lint/UnusedBlockArgument: + Description: 'Checks for unused block arguments.' + Enabled: true + +Lint/UnusedMethodArgument: + Description: 'Checks for unused method arguments.' + Enabled: true + +Lint/UnreachableCode: + Description: 'Unreachable code.' + Enabled: true + +Lint/UselessAccessModifier: + Description: 'Checks for useless access modifiers.' + Enabled: true + +Lint/UselessAssignment: + Description: 'Checks for useless assignment to a local variable.' + Enabled: true + +Lint/UselessComparison: + Description: 'Checks for comparison of something with itself.' + Enabled: true + +Lint/UselessElseWithoutRescue: + Description: 'Checks for useless `else` in `begin..end` without `rescue`.' + Enabled: true + +Lint/UselessSetterCall: + Description: 'Checks for useless setter call to a local variable.' + Enabled: true + +Lint/Void: + Description: 'Possible use of operator/literal/variable in void context.' + Enabled: true + +##################### Rails ################################## + +Rails/ActionFilter: + Description: 'Enforces consistent use of action filter methods.' + Enabled: false + +Rails/Delegate: + Description: 'Prefer delegate method for delegations.' + Enabled: true + +Rails/HasAndBelongsToMany: + Description: 'Prefer has_many :through to has_and_belongs_to_many.' + Enabled: false + +Rails/Output: + Description: 'Checks for calls to puts, print, etc.' + Enabled: true + +Rails/ReadWriteAttribute: + Description: >- + Checks for read_attribute(:attr) and + write_attribute(:attr, val). + Enabled: true + +Rails/ScopeArgs: + Description: 'Checks the arguments of ActiveRecord scopes.' + Enabled: true + +Rails/Validation: + Description: 'Use sexy validations.' + Enabled: true diff --git a/Eyefile b/Eyefile new file mode 100644 index 000000000..eb708778e --- /dev/null +++ b/Eyefile @@ -0,0 +1 @@ +Eye.load('config/processes/app.eye') diff --git a/Gemfile b/Gemfile index 5d8f77eba..c8e567346 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' gem 'rails', '~> 3.2.22' gem 'rack-protection', '~> 1.5.3' -gem 'secure_headers', '~> 2.2.3' +gem 'secure_headers', '~> 2.5.1' gem 'rack-mini-profiler', require: false @@ -11,9 +11,9 @@ gem 'pry-rails', '~> 0.3.2' gem 'pg', '~> 0.18.1' gem 'foreigner', '~> 1.7.2' -gem 'rdf', '~> 1.1.15' -gem 'rdf-rdfxml', '~> 1.1.3' -gem 'rdf-n3', '~> 1.1.2' +gem 'rdf', '~> 1.99.0' +gem 'rdf-rdfxml', '~> 1.99.0' +gem 'rdf-n3', '~> 1.99.0' gem 'redis-semaphore', '~> 0.2.4' @@ -21,27 +21,28 @@ gem 'redis-semaphore', '~> 0.2.4' # in production environments by default. group :assets do gem 'jstree-rails', github: 'tristanm/jstree-rails' - # sass-rails >= 4.0 is not compativle with rails 3 + # sass-rails >= 4.0 is not compativle to rails 3 gem 'sass-rails', '~> 3.2.6' - gem 'bootstrap-sass', '~> 3.3.3' - # coffee-rails > 3.2 is not compatible with rails 3 + # bootstrap-sass >= 3.3.6 is not compatible to rails 3 + gem 'bootstrap-sass', '~> 3.3.5.1' + # coffee-rails > 3.2 is not compatible to rails 3 gem 'coffee-rails', '~> 3.2.2' gem 'compass', '~> 1.0.3' - gem 'font-awesome-sass', '~> 4.4.0' - # jquery-rails > 3.1 is not compatible with rails 3 + gem 'font-awesome-sass', '~> 4.5.0' + # jquery-rails > 3.1 is not compatible to rails 3 gem 'jquery-rails', '~> 3.1.3' gem 'jquery-ui-rails', '~> 5.0.5' - gem 'momentjs-rails', '~> 2.10.2' + gem 'momentjs-rails', '~> 2.11.0' gem 'd3_rails', '~> 3.5.6' gem 'therubyracer', '~> 0.12.1' gem 'uglifier', '>= 1.0.3' - gem 'handlebars_assets', '~> 0.20.1' + gem 'handlebars_assets', '~> 0.22.0' gem 'hamlbars', '~> 2.1.1' gem 'underscore-rails', '~> 1.8.2' gem 'bootstrap-select-rails', '~> 1.6.3' end -# Newer versions than 0.4 are not compatible with rails 3.2 +# Newer versions than 0.4 are not compatible to rails 3.2 gem 'haml-rails', '~> 0.4' # Project configuration @@ -50,11 +51,11 @@ gem 'haml-rails', '~> 0.4' # https://github.com/railsconfig/rails_config/pull/103 gem 'rails_config', github: 'dtaniwaki/rails_config', ref: 'merge-array-option' -#provides correct indefinite article +# Provides correct indefinite article gem 'indefinite_article', '~> 0.2.0' # Fancy Forms -# simple_form >= 3.0 is not compatible with rails 3 +# simple_form >= 3.0 is not compatible to rails 3 gem 'simple_form', '~> 2.1' # Inherited Resources @@ -68,7 +69,7 @@ gem 'active_model_serializers', '~> 0.9.3' gem 'json-stream', '~> 0.2.1' # XML Parser -gem 'nokogiri', '~> 1.6.6.2' +gem 'nokogiri', '~> 1.6.7' # Authentication gem 'devise', '~> 3.5.2' @@ -83,16 +84,18 @@ gem 'kaminari', '~> 0.16.1' gem "strip_attributes", "~> 1.0" # For distributed ontologies -gem 'acts_as_tree', '~> 2.2.0' +gem 'acts_as_tree', '~> 2.4.0' # HTTP Client gem "rest-client", '~> 1.8.0' # Background-Jobs -gem 'sidekiq', '~> 3.4.2' -gem 'sidetiq', '~> 0.6.3' +gem 'sidekiq', '~> 3.5.3' +# Originally, sidetiq is not compatible to celluloid 0.17.2. This fork fixes it. +# The ref is given to ensure that no other (possibly breaking) changes are taken. +gem 'sidetiq', github: 'PaulMest/sidetiq', ref: 'd88f9e483affcbadbd9e8b98b4a0a9518933887a' gem 'sidekiq-failures', '~> 0.4.5' -gem 'sidekiq-status', '~> 0.5.4' +gem 'sidekiq-status', '~> 0.6.0' gem 'sinatra', '~> 1.4.5', require: false, group: [:development, :production] # Search engine @@ -106,7 +109,7 @@ gem 'elasticsearch-extensions', '~> 0.0.15' gem 'ruby-graphviz', "~> 1.2.2" # Fake-inputs for tests and seeds -gem "faker", "~> 1.5.0" +gem "faker", "~> 1.6.1" # Git gem 'rugged', '~> 0.23.2' @@ -115,11 +118,8 @@ gem 'codemirror-rails', github: 'llwt/codemirror-rails' # API gem 'specroutes', github: '0robustus1/specroutes' -# Ancestry enabling tree structure in category model -# gem 'ancestry' - # Use dagnabit to model categories -# Newer versions than 3.0.x are not compatible with rails 3.2 +# Newer versions than 3.0.x are not compatible to rails 3.2 gem 'dagnabit', '~> 3.0.1' # Migrate data in separate tasks @@ -129,7 +129,7 @@ gem 'data_migrate', '~> 1.2.0' gem 'acts_as_relation', '~> 0.1.3' # Clean the database - especially needed in the seeds -gem 'database_cleaner', '~> 1.4.1' +gem 'database_cleaner', '~> 1.5.1' group :test do gem 'mocha', '~> 1.1.0', require: false @@ -141,16 +141,16 @@ group :test do gem "factory_girl_rails", '~> 4.5.0' # Required for integration tests - gem 'capybara', '~> 2.4.4' - gem 'poltergeist', '~> 1.6.0' + gem 'capybara', '~> 2.5.0' + gem 'poltergeist', '~> 1.8.0' gem 'launchy', '~> 2.4.3' gem 'cucumber-rails', '~> 1.4', require: false # Code Coverage Analysis - gem 'simplecov', '~> 0.10.0', require: false + gem 'simplecov', '~> 0.11.0', require: false # So we can validate against json-schemas - gem 'json-schema', '~> 2.5.0' + gem 'json-schema', '~> 2.6.0' # Writing test ontologies gem 'ontology-united', github: '0robustus1/ontology-united' @@ -166,18 +166,19 @@ group :development, :test do gem 'rspec-rails', '~> 2.0' gem 'better_errors', '~> 2.1.1' gem 'binding_of_caller', '~> 0.7.2' + # i18n-tasks >= 0.9.0 is not compatible to rails 3/rdf gem 'i18n-tasks', '~> 0.8.3' - gem 'pry-byebug', '~> 3.2.0' + gem 'pry-byebug', '~> 3.3.0' # Recording of HTTP Requests - gem "vcr", '~> 2.9.3', require: false - gem "webmock", '~> 1.21.0', require: false + gem "vcr", '~> 3.0.0', require: false + gem "webmock", '~> 1.22.3', require: false end group :production do # puma is __the only exception__ for which we don't specify a version. gem 'puma' - gem 'god', '~> 0.13.4' + gem 'eye', '~> 0.8' gem 'exception_notification', '~> 4.1.0' end diff --git a/Gemfile.lock b/Gemfile.lock index 8980d796b..b87b8a826 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,6 +12,16 @@ GIT libxml-ruby (~> 2.8.0) rails (~> 3.2.21) +GIT + remote: git://github.com/PaulMest/sidetiq.git + revision: d88f9e483affcbadbd9e8b98b4a0a9518933887a + ref: d88f9e483affcbadbd9e8b98b4a0a9518933887a + specs: + sidetiq (0.6.3) + celluloid (>= 0.14.1) + ice_cube (= 0.11.1) + sidekiq (>= 3.0.0) + GIT remote: git://github.com/dtaniwaki/rails_config.git revision: e07c116d5591d31584215ac3bccc50321eef23f2 @@ -29,7 +39,7 @@ GIT GIT remote: git://github.com/tristanm/jstree-rails.git - revision: e2ad211ea7835a1811e66c3d4ef1e21bfbe6e27d + revision: 66fbbb9ffc4ce8963cbd1717ef100864e7c5df1d specs: jstree-rails (0.0.1) rails (>= 3.1) @@ -38,12 +48,12 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (2.2.8) - actionmailer (3.2.22) - actionpack (= 3.2.22) + actionmailer (3.2.22.1) + actionpack (= 3.2.22.1) mail (~> 2.5.4) - actionpack (3.2.22) - activemodel (= 3.2.22) - activesupport (= 3.2.22) + actionpack (3.2.22.1) + activemodel (= 3.2.22.1) + activesupport (= 3.2.22.1) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.4) @@ -51,30 +61,30 @@ GEM rack-cache (~> 1.2) rack-test (~> 0.6.1) sprockets (~> 2.2.1) - active_model_serializers (0.9.3) + active_model_serializers (0.9.4) activemodel (>= 3.2) - activemodel (3.2.22) - activesupport (= 3.2.22) + activemodel (3.2.22.1) + activesupport (= 3.2.22.1) builder (~> 3.0.0) - activerecord (3.2.22) - activemodel (= 3.2.22) - activesupport (= 3.2.22) + activerecord (3.2.22.1) + activemodel (= 3.2.22.1) + activesupport (= 3.2.22.1) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activeresource (3.2.22) - activemodel (= 3.2.22) - activesupport (= 3.2.22) - activesupport (3.2.22) + activeresource (3.2.22.1) + activemodel (= 3.2.22.1) + activesupport (= 3.2.22.1) + activesupport (3.2.22.1) i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) acts_as_relation (0.1.3) activerecord (~> 3.2) - acts_as_tree (2.2.0) + acts_as_tree (2.4.0) activerecord (>= 3.0.0) addressable (2.3.8) ansi (1.5.0) arel (3.0.3) - autoprefixer-rails (5.2.1.2) + autoprefixer-rails (6.3.1) execjs json bcrypt (3.1.10) @@ -89,8 +99,7 @@ GEM sass (>= 3.3.0) bootstrap-select-rails (1.6.3) builder (3.0.4) - byebug (5.0.0) - columnize (= 0.9.0) + byebug (8.2.1) cancan (1.6.10) capistrano (3.4.0) i18n @@ -99,22 +108,41 @@ GEM capistrano-bundler (1.1.4) capistrano (~> 3.1) sshkit (~> 1.2) - capistrano-rails (1.1.3) + capistrano-rails (1.1.5) capistrano (~> 3.1) capistrano-bundler (~> 1.1) capistrano-rvm (0.1.2) capistrano (~> 3.0) sshkit (~> 1.2) - capybara (2.4.4) + capybara (2.5.0) mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) - celluloid (0.16.0) - timers (~> 4.0.0) + celluloid (0.17.2) + celluloid-essentials + celluloid-extras + celluloid-fsm + celluloid-pool + celluloid-supervision + timers (>= 4.1.1) + celluloid-essentials (0.20.5) + timers (>= 4.1.1) + celluloid-extras (0.20.5) + timers (>= 4.1.1) + celluloid-fsm (0.20.5) + timers (>= 4.1.1) + celluloid-io (0.17.2) + celluloid (>= 0.17.2) + nio4r (>= 1.1) + timers (>= 4.1.1) + celluloid-pool (0.20.5) + timers (>= 4.1.1) + celluloid-supervision (0.20.5) + timers (>= 4.1.1) choice (0.2.0) - chunky_png (1.3.4) + chunky_png (1.3.5) cliver (0.3.2) coderay (1.1.0) coffee-rails (3.2.2) @@ -123,9 +151,7 @@ GEM coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.9.1.1) - colorize (0.7.7) - columnize (0.9.0) + coffee-script-source (1.10.0) compass (1.0.3) chunky_png (~> 1.2) compass-core (~> 1.0.2) @@ -139,7 +165,7 @@ GEM compass-import-once (1.0.5) sass (>= 3.2, < 3.5) connection_pool (2.2.0) - crack (0.4.2) + crack (0.4.3) safe_yaml (~> 1.0.0) cucumber (1.3.20) builder (>= 2.1.2) @@ -153,15 +179,15 @@ GEM mime-types (>= 1.16, < 3) nokogiri (~> 1.5) rails (>= 3, < 5) - d3_rails (3.5.6) + d3_rails (3.5.11) railties (>= 3.1.0) dagnabit (3.0.1) activerecord (>= 2.3.0) data_migrate (1.2.0) rails (>= 3.0.0) - database_cleaner (1.4.1) + database_cleaner (1.5.1) debug_inspector (0.0.2) - devise (3.5.2) + devise (3.5.5) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 3.2.6, < 5) @@ -170,37 +196,43 @@ GEM warden (~> 1.2.3) diff-lcs (1.2.5) docile (1.1.5) - domain_name (0.5.24) + domain_name (0.5.25) unf (>= 0.0.5, < 1.0.0) dotenv (1.0.2) easy_translate (0.5.0) json thread thread_safe - elasticsearch (1.0.12) - elasticsearch-api (= 1.0.12) - elasticsearch-transport (= 1.0.12) - elasticsearch-api (1.0.12) + elasticsearch (1.0.15) + elasticsearch-api (= 1.0.15) + elasticsearch-transport (= 1.0.15) + elasticsearch-api (1.0.15) multi_json - elasticsearch-extensions (0.0.18) + elasticsearch-extensions (0.0.20) ansi ruby-prof - elasticsearch-model (0.1.7) + elasticsearch-model (0.1.8) activesupport (> 3) elasticsearch (> 0.4) hashie - elasticsearch-rails (0.1.7) - elasticsearch-transport (1.0.12) + elasticsearch-rails (0.1.8) + elasticsearch-transport (1.0.15) faraday multi_json em-proxy (0.1.8) eventmachine erubis (2.7.0) - eventmachine (1.0.8) + eventmachine (1.0.9.1) exception_notification (4.1.1) actionmailer (>= 3.0.4) activesupport (>= 3.0.4) execjs (2.6.0) + eye (0.8) + celluloid (~> 0.17.2) + celluloid-io (~> 0.17.0) + sigar (~> 0.7.3) + state_machine + thor facter (2.4.4) CFPropertyList (~> 2.2.6) factory_girl (4.5.0) @@ -208,19 +240,18 @@ GEM factory_girl_rails (4.5.0) factory_girl (~> 4.5.0) railties (>= 3.0.0) - faker (1.5.0) + faker (1.6.1) i18n (~> 0.5) - faraday (0.9.1) + faraday (0.9.2) multipart-post (>= 1.2, < 3) ffi (1.9.10) - font-awesome-sass (4.4.0) + font-awesome-sass (4.5.0) sass (>= 3.2) foreigner (1.7.4) activerecord (>= 3.0.0) formatador (0.2.5) gherkin (2.12.2) multi_json (~> 1.3) - god (0.13.6) haml (4.0.7) tilt haml-rails (0.4) @@ -233,7 +264,7 @@ GEM haml sprockets (>= 2.0) tilt - handlebars_assets (0.20.2) + handlebars_assets (0.22.0) execjs (~> 2.0) multi_json (~> 1.0) sprockets (>= 2.0.0, < 4.0) @@ -241,22 +272,23 @@ GEM has_scope (0.6.0) actionpack (>= 3.2, < 5) activesupport (>= 3.2, < 5) - hashie (3.4.2) - highline (1.6.21) + hashdiff (0.2.3) + hashie (3.4.3) + highline (1.7.8) hike (1.2.3) - hitimes (1.2.2) + hitimes (1.2.3) htmlentities (4.3.4) http-cookie (1.0.2) domain_name (~> 0.5) http-parser-lite (0.6.0) i18n (0.7.0) - i18n-tasks (0.8.6) - activesupport + i18n-tasks (0.8.7) + activesupport (>= 2.3.18) easy_translate (>= 0.5.0) erubis - highline + highline (>= 1.7.3) i18n - term-ansicolor + term-ansicolor (>= 1.3.2) terminal-table (>= 1.5.1) ice_cube (0.11.1) indefinite_article (0.2.4) @@ -264,7 +296,7 @@ GEM inherited_resources (1.4.1) has_scope (~> 0.6.0.rc) responders (~> 1.0.0.rc) - iniparse (1.4.1) + iniparse (1.4.2) invoker (1.3.2) dotenv (~> 1.0.2) em-proxy (~> 0.1) @@ -278,21 +310,21 @@ GEM thor (~> 0.19) uuid (~> 2.3) journey (1.0.4) - jquery-rails (3.1.3) + jquery-rails (3.1.4) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) jquery-ui-rails (5.0.5) railties (>= 3.2.16) json (1.8.3) - json-schema (2.5.1) - addressable (~> 2.3.7) + json-schema (2.6.0) + addressable (~> 2.3.8) json-stream (0.2.1) kaminari (0.16.3) actionpack (>= 3.0.0) activesupport (>= 3.0.0) launchy (2.4.3) addressable (~> 2.3) - libv8 (3.16.14.11) + libv8 (3.16.14.13) libxml-ruby (2.8.0) link_header (0.0.8) macaddr (1.7.1) @@ -303,48 +335,49 @@ GEM metaclass (0.0.4) method_source (0.8.2) mime-types (1.25.1) - mini_portile (0.6.2) + mini_portile2 (2.0.0) mocha (1.1.0) metaclass (~> 0.0.1) - momentjs-rails (2.10.3) + momentjs-rails (2.11.0) railties (>= 3.1) multi_json (1.11.2) multi_test (0.1.2) multipart-post (2.0.0) net-scp (1.2.1) net-ssh (>= 2.6.5) - net-ssh (2.9.2) - netrc (0.10.3) - nokogiri (1.6.6.2) - mini_portile (~> 0.6.0) + net-ssh (3.0.2) + netrc (0.11.0) + nio4r (1.2.0) + nokogiri (1.6.7.2) + mini_portile2 (~> 2.0.0.rc2) options (2.3.2) orm_adapter (0.5.0) - pg (0.18.2) - poltergeist (1.6.0) + pg (0.18.4) + poltergeist (1.8.1) capybara (~> 2.1) cliver (~> 0.3.1) multi_json (~> 1.0) websocket-driver (>= 0.2.0) polyglot (0.3.5) - progress_bar (1.0.3) - highline (~> 1.6.1) + progress_bar (1.0.5) + highline (~> 1.6) options (~> 2.3.0) - pry (0.10.1) + pry (0.10.3) coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) - pry-byebug (3.2.0) - byebug (~> 5.0) + pry-byebug (3.3.0) + byebug (~> 8.0) pry (~> 0.10) pry-rails (0.3.4) pry (>= 0.9.10) - puma (2.13.4) + puma (2.15.3) quiet_assets (1.1.0) railties (>= 3.1, < 5.0) rack (1.4.7) - rack-cache (1.2) + rack-cache (1.5.1) rack (>= 0.4) - rack-mini-profiler (0.9.7) + rack-mini-profiler (0.9.8) rack (>= 1.1.3) rack-protection (1.5.3) rack @@ -352,54 +385,54 @@ GEM rack rack-test (0.6.3) rack (>= 1.0) - rails (3.2.22) - actionmailer (= 3.2.22) - actionpack (= 3.2.22) - activerecord (= 3.2.22) - activeresource (= 3.2.22) - activesupport (= 3.2.22) + rails (3.2.22.1) + actionmailer (= 3.2.22.1) + actionpack (= 3.2.22.1) + activerecord (= 3.2.22.1) + activeresource (= 3.2.22.1) + activesupport (= 3.2.22.1) bundler (~> 1.0) - railties (= 3.2.22) - rails-erd (1.4.2) + railties (= 3.2.22.1) + rails-erd (1.4.5) activerecord (>= 3.2) activesupport (>= 3.2) choice (~> 0.2.0) ruby-graphviz (~> 1.2) - railties (3.2.22) - actionpack (= 3.2.22) - activesupport (= 3.2.22) + railties (3.2.22.1) + actionpack (= 3.2.22.1) + activesupport (= 3.2.22.1) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) rainbow (2.0.0) - rake (10.4.2) - rb-fsevent (0.9.5) + rake (10.5.0) + rb-fsevent (0.9.7) rb-inotify (0.9.5) ffi (>= 0.5.0) - rdf (1.1.15) + rdf (1.99.1) link_header (~> 0.0, >= 0.0.8) - rdf-aggregate-repo (1.1.0) - rdf (>= 1.1) - rdf-n3 (1.1.3) - rdf (~> 1.1, >= 1.1.5) - rdf-rdfa (1.1.6) + rdf-aggregate-repo (1.99.0) + rdf (~> 1.99) + rdf-n3 (1.99.0) + rdf (~> 1.99) + rdf-rdfa (1.99.0) haml (~> 4.0) htmlentities (~> 4.3) - rdf (~> 1.1, >= 1.1.6) + rdf (~> 1.99) rdf-aggregate-repo (~> 1.1) rdf-xsd (~> 1.1) - rdf-rdfxml (1.1.4) + rdf-rdfxml (1.99.0) htmlentities (~> 4.3) - rdf (~> 1.1, >= 1.1.6) - rdf-rdfa (~> 1.1, >= 1.1.4.1) - rdf-xsd (~> 1.1) - rdf-xsd (1.1.4) - rdf (~> 1.1, >= 1.1.9) + rdf (~> 1.99) + rdf-rdfa (~> 1.99) + rdf-xsd (~> 1.99) + rdf-xsd (1.99.0) + rdf (~> 1.99) rdoc (3.12.2) json (~> 1.4) - redcarpet (3.3.2) - redis (3.2.1) + redcarpet (3.3.4) + redis (3.2.2) redis-namespace (1.5.2) redis (~> 3.0, >= 3.0.4) redis-semaphore (0.2.4) @@ -411,7 +444,7 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 3.0) netrc (~> 0.7) - rspec-activemodel-mocks (1.0.1) + rspec-activemodel-mocks (1.0.2) activemodel (>= 3.0) activesupport (>= 3.0) rspec-mocks (>= 2.99, < 4.0) @@ -434,17 +467,17 @@ GEM rspec-expectations (~> 2.99.0) rspec-mocks (~> 2.99.0) ruby-graphviz (1.2.2) - ruby-prof (0.15.8) + ruby-prof (0.15.9) rubydns (0.8.5) eventmachine (~> 1.0.0) - rugged (0.23.2) + rugged (0.23.3) safe_yaml (1.0.4) - sass (3.4.17) + sass (3.4.21) sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) - secure_headers (2.2.3) + secure_headers (2.5.1) user_agent_parser shoulda (3.5.0) shoulda-context (~> 1.0, >= 1.0.1) @@ -453,24 +486,21 @@ GEM shoulda-matchers (2.8.0) activesupport (>= 3.0.0) shoulda_routing_macros (0.1.2) - sidekiq (3.4.2) - celluloid (~> 0.16.0) + sidekiq (3.5.4) + celluloid (~> 0.17.2) connection_pool (~> 2.2, >= 2.2.0) json (~> 1.0) redis (~> 3.2, >= 3.2.1) redis-namespace (~> 1.5, >= 1.5.2) sidekiq-failures (0.4.5) sidekiq (>= 2.16.0) - sidekiq-status (0.5.4) + sidekiq-status (0.6.0) sidekiq (>= 2.7) - sidetiq (0.6.3) - celluloid (>= 0.14.1) - ice_cube (= 0.11.1) - sidekiq (>= 3.0.0) + sigar (0.7.3) simple_form (2.1.3) actionpack (~> 3.0) activemodel (~> 3.0) - simplecov (0.10.0) + simplecov (0.11.1) docile (~> 1.1.0) json (~> 1.8) simplecov-html (~> 0.10.0) @@ -485,10 +515,10 @@ GEM multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sshkit (1.7.1) - colorize (>= 0.7.0) + sshkit (1.8.1) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) + state_machine (1.2.0) strip_attributes (1.7.1) activemodel (>= 3.0, < 5.0) systemu (2.6.5) @@ -502,13 +532,13 @@ GEM thread (0.2.2) thread_safe (0.3.5) tilt (1.4.1) - timers (4.0.1) + timers (4.1.1) hitimes - tins (1.6.0) + tins (1.8.1) treetop (1.4.15) polyglot polyglot (>= 0.3.1) - tzinfo (0.3.44) + tzinfo (0.3.46) uglifier (2.7.2) execjs (>= 0.3.0) json (>= 1.8.0) @@ -516,16 +546,17 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.7.1) - user_agent_parser (2.2.0) + user_agent_parser (2.3.0) uuid (2.3.8) macaddr (~> 1.0) - vcr (2.9.3) - warden (1.2.3) + vcr (3.0.1) + warden (1.2.4) rack (>= 1.0) - webmock (1.21.0) + webmock (1.22.6) addressable (>= 2.3.6) crack (>= 0.3.2) - websocket-driver (0.6.2) + hashdiff + websocket-driver (0.6.3) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) xpath (2.0.0) @@ -538,16 +569,16 @@ PLATFORMS DEPENDENCIES active_model_serializers (~> 0.9.3) acts_as_relation (~> 0.1.3) - acts_as_tree (~> 2.2.0) + acts_as_tree (~> 2.4.0) better_errors (~> 2.1.1) binding_of_caller (~> 0.7.2) - bootstrap-sass (~> 3.3.3) + bootstrap-sass (~> 3.3.5.1) bootstrap-select-rails (~> 1.6.3) cancan (~> 1.6.7) capistrano (~> 3.4.0) capistrano-rails (~> 1.1.1) capistrano-rvm (~> 0.1.1) - capybara (~> 2.4.4) + capybara (~> 2.5.0) codemirror-rails! coffee-rails (~> 3.2.2) compass (~> 1.0.3) @@ -555,21 +586,21 @@ DEPENDENCIES d3_rails (~> 3.5.6) dagnabit (~> 3.0.1) data_migrate (~> 1.2.0) - database_cleaner (~> 1.4.1) + database_cleaner (~> 1.5.1) devise (~> 3.5.2) elasticsearch (~> 1.0.4) elasticsearch-extensions (~> 0.0.15) elasticsearch-model (~> 0.1.4) elasticsearch-rails (~> 0.1.4) exception_notification (~> 4.1.0) + eye (~> 0.8) factory_girl_rails (~> 4.5.0) - faker (~> 1.5.0) - font-awesome-sass (~> 4.4.0) + faker (~> 1.6.1) + font-awesome-sass (~> 4.5.0) foreigner (~> 1.7.2) - god (~> 0.13.4) haml-rails (~> 0.4) hamlbars (~> 2.1.1) - handlebars_assets (~> 0.20.1) + handlebars_assets (~> 0.22.0) has_scope (~> 0.6.0.rc) i18n-tasks (~> 0.8.3) indefinite_article (~> 0.2.0) @@ -577,19 +608,19 @@ DEPENDENCIES invoker (~> 1.3.2) jquery-rails (~> 3.1.3) jquery-ui-rails (~> 5.0.5) - json-schema (~> 2.5.0) + json-schema (~> 2.6.0) json-stream (~> 0.2.1) jstree-rails! kaminari (~> 0.16.1) launchy (~> 2.4.3) mocha (~> 1.1.0) - momentjs-rails (~> 2.10.2) - nokogiri (~> 1.6.6.2) + momentjs-rails (~> 2.11.0) + nokogiri (~> 1.6.7) ontology-united! pg (~> 0.18.1) - poltergeist (~> 1.6.0) + poltergeist (~> 1.8.0) progress_bar (~> 1.0.2) - pry-byebug (~> 3.2.0) + pry-byebug (~> 3.3.0) pry-rails (~> 0.3.2) puma quiet_assets (~> 1.1.0) @@ -598,9 +629,9 @@ DEPENDENCIES rails (~> 3.2.22) rails-erd (~> 1.4.2) rails_config! - rdf (~> 1.1.15) - rdf-n3 (~> 1.1.2) - rdf-rdfxml (~> 1.1.3) + rdf (~> 1.99.0) + rdf-n3 (~> 1.99.0) + rdf-rdfxml (~> 1.99.0) redcarpet (~> 3.3.2) redis-semaphore (~> 0.2.4) rest-client (~> 1.8.0) @@ -610,24 +641,24 @@ DEPENDENCIES ruby-graphviz (~> 1.2.2) rugged (~> 0.23.2) sass-rails (~> 3.2.6) - secure_headers (~> 2.2.3) + secure_headers (~> 2.5.1) shoulda (~> 3.5.0) shoulda_routing_macros (~> 0.1.2) - sidekiq (~> 3.4.2) + sidekiq (~> 3.5.3) sidekiq-failures (~> 0.4.5) - sidekiq-status (~> 0.5.4) - sidetiq (~> 0.6.3) + sidekiq-status (~> 0.6.0) + sidetiq! simple_form (~> 2.1) - simplecov (~> 0.10.0) + simplecov (~> 0.11.0) sinatra (~> 1.4.5) specroutes! strip_attributes (~> 1.0) therubyracer (~> 0.12.1) uglifier (>= 1.0.3) underscore-rails (~> 1.8.2) - vcr (~> 2.9.3) - webmock (~> 1.21.0) + vcr (~> 3.0.0) + webmock (~> 1.22.3) yard (~> 0.8.7.6) BUNDLED WITH - 1.10.6 + 1.11.2 diff --git a/app/assets/javascripts/repository/edit_remote.js.coffee b/app/assets/javascripts/repository/edit_remote.js.coffee index 51d9b77b0..f3c8d533e 100644 --- a/app/assets/javascripts/repository/edit_remote.js.coffee +++ b/app/assets/javascripts/repository/edit_remote.js.coffee @@ -1,16 +1,24 @@ $ -> if $('#repository_form').length > 0 - mirror_option = (o) -> o.value.search(/_rw/) == -1 - to_mirror_option = (value) -> value.split("_")[0] + "_r" - to_non_mirror_option = (value) -> value - input_access_el = $('#repository_form #repository_access')[0] - source_address_el = $('#repository_form #repository_source_address') - options_all = input_access_el.options - options_non_mirror = _.clone(options_all) - options_mirror = _.filter(options_all, mirror_option) + to_mirror_option = (previous_option) -> + previous_option.split("_")[0] + "_r" - type_el = $($('#repository_form #remote_type')[0]) + to_non_mirror_option = (previous_option) -> + if previous_option.split('_')[0] == 'public' + previous_option + else + 'private_rw' + + input_access_el = $('#repository_access')[0] + source_address_el = $('#repository_source_address') + remote_type_els = $('input[name="repository[remote_type]"]') + remote_type_mirror_el = $('#repository_remote_type_mirror') + + options_non_mirror = _.clone($('#access_options_non_mirror')[0].options) + options_mirror = _.clone($('#access_options_mirror')[0].options) + + type_el = $($('#remote_type')[0]) # If options are not set one by one, the select box wont change. set_options = (options, converter, last_value) -> @@ -26,20 +34,28 @@ $ -> else set_options(options_non_mirror, to_non_mirror_option, last_value) - is_source_address_set = () -> + is_mirror_active = -> + is_mirror_selected() && is_source_address_set() + + is_mirror_selected = -> + remote_type_mirror_el.is(':checked') + + is_source_address_set = -> source_address_el.val().trim().length > 0 + was_mirror_active = is_mirror_selected() + was_source_address_set = is_source_address_set() - reset_was_source_address_set = () -> + reset_was_source_address_set = -> was_source_address_set = is_source_address_set() change_options = (event) -> - if !was_source_address_set && is_source_address_set() + if !was_mirror_active && is_mirror_active() modify_access_list 'mirror' - else if was_source_address_set && !is_source_address_set() + else if was_mirror_active && !is_mirror_active() modify_access_list 'non_mirror' - else if !was_source_address_set && !is_source_address_set() + else if !was_mirror_active && !is_mirror_active() modify_access_list 'non_mirror' change_type_display = (event) -> @@ -55,7 +71,10 @@ $ -> change_options() change_type_display() - source_address_el.on('input', change_options) source_address_el.on('input', change_type_display) source_address_el.on('input', reset_was_source_address_set) + source_address_el.on('input', change_options) + _.each(remote_type_els, (el) -> + $(el).on('click', change_options) + ) return diff --git a/app/controllers/api/v1/combinations_controller.rb b/app/controllers/api/v1/combinations_controller.rb index d043145cb..ac71f61ad 100644 --- a/app/controllers/api/v1/combinations_controller.rb +++ b/app/controllers/api/v1/combinations_controller.rb @@ -15,7 +15,7 @@ def create else response.status = 400 render json: {status: response.message, - error: errors_str} + errors: [errors_str]} end end diff --git a/app/controllers/axioms_controller.rb b/app/controllers/axioms_controller.rb index bf50ad030..ebc2be140 100644 --- a/app/controllers/axioms_controller.rb +++ b/app/controllers/axioms_controller.rb @@ -2,7 +2,6 @@ # Lists axioms of an ontology # class AxiomsController < InheritedResources::Base - belongs_to :ontology actions :index @@ -27,9 +26,11 @@ def collection else parent.translated_axioms end - Kaminari.paginate_array(axioms).page(params[:page]) + Kaminari.paginate_array(axioms).page(params[:page]). + per(params[:per_page]) else - Kaminari.paginate_array(parent.axioms.original).page(params[:page]) + Kaminari.paginate_array(parent.axioms.original).page(params[:page]). + per(params[:per_page]) end end diff --git a/app/controllers/ontologies_controller.rb b/app/controllers/ontologies_controller.rb index 59a8edc81..5067917a3 100644 --- a/app/controllers/ontologies_controller.rb +++ b/app/controllers/ontologies_controller.rb @@ -73,13 +73,14 @@ def show end def destroy - if resource.is_imported? - flash[:error] = "Can't delete #{Settings.OMS.with_indefinite_article} - that is imported by another one." - redirect_to resource_chain - else + if resource.can_be_deleted? resource.destroy_with_parent(current_user) destroy! + else + flash[:error] = t('ontology.delete_error', + oms_with_article: Settings.OMS.with_indefinite_article, + oms: Settings.OMS) + redirect_to resource_chain end end diff --git a/app/fake_records/proof.rb b/app/fake_records/proof.rb index 54203f6cc..f777a3664 100644 --- a/app/fake_records/proof.rb +++ b/app/fake_records/proof.rb @@ -112,11 +112,6 @@ def normalize_check_box_ids(collection) collection.select(&:present?).map(&:to_i) if collection end - def initialize_axioms(opts) - axiom_ids = normalize_check_box_ids(opts[:proof][:axioms]) - @axioms = axiom_ids.map { |id| Axiom.find(id) } if axiom_ids - end - def initialize_axiom_selection(opts) @axiom_selection_method = opts[:proof][:axiom_selection_method].try(:to_sym) build_axiom_selection(opts) diff --git a/app/helpers/pagination_helper.rb b/app/helpers/pagination_helper.rb index 17c4a41bd..4268a1bc1 100644 --- a/app/helpers/pagination_helper.rb +++ b/app/helpers/pagination_helper.rb @@ -1,10 +1,9 @@ module PaginationHelper - - def pagination(collection=nil, &block) + def pagination(collection = nil, **options, &block) # call the collection-method if no collection is given collection ||= send :collection - pages = paginate(collection) + pages = paginate(collection, **options) html = '' html << pages @@ -13,4 +12,53 @@ def pagination(collection=nil, &block) html.html_safe end + # Kaminari generates a URL from the params hash. The URL is, however, not + # compatible to loc/ids. + # This method builds the loc/id compatible link to the page. + def build_link_from_request(kaminari_url) + page, per_page = params_from_kaminari_url(kaminari_url) + + query_string_parts = request.env['QUERY_STRING']. + split(/;|&/). + map { |p| p.split('=') } + + query_string_parts = replace_page_params(query_string_parts, page, per_page) + query_string = build_query_string(query_string_parts) + + [request.env['REQUEST_PATH'], query_string].compact.join('?') + end + + # Kaminari generates a URL from the params hash. The URL is, however, not + # compatible to loc/ids. + # This method extracts the page number and page size from the generated url. + def params_from_kaminari_url(kaminari_url) + page = + if (match = kaminari_url.match(/[\?&]page=(\d+)/)) ? match[1] : 1 + match[1] + end + per_page = + if match = kaminari_url.match(/[\?&]per_page=(\d+)/) + match[1] + end + [page || 1, per_page] + end + + private + + def replace_page_params(page, per_page) + query_string_parts.reject! { |p| p.first == 'page' } if page + query_string_parts.reject! { |p| p.first == 'per_page' } if per_page + + query_string_parts << ['page', page] if page + if per_page && per_page != :default + query_string_parts << ['per_page', per_page] + end + + query_string_parts + end + + def build_query_string(query_string_parts) + query_string = query_string_parts.map { |p| p.join('=') }.join('&') + query_string if query_string.present? + end end diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 51807a8cc..964ebac89 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -12,8 +12,8 @@ def clone_methods(visible: Repository::DEFAULT_CLONE_TYPE) # end.join(', ') # end - def clone_method_link(method) - link_to method, "##{method}", class: 'clone_method_link', data: {clone: method} + def clone_method_link(method, text) + link_to(text, "##{method}", class: 'clone_method_link', data: {clone: method}) end def clone_type @@ -34,13 +34,11 @@ def access_change_hint end def access_options - t('repository.access.options').select do |k,v| - if @repository.mirror? - k.to_s.split('_')[1] == 'r' - else - true - end - end.invert + t('repository.access.options').invert + end + + def access_options_mirror + t('repository.access.options_mirror').invert end def repository_modal_body diff --git a/app/helpers/state_helper.rb b/app/helpers/state_helper.rb index eaf3e450d..17171c139 100644 --- a/app/helpers/state_helper.rb +++ b/app/helpers/state_helper.rb @@ -30,7 +30,8 @@ def state_tag(resource) resource = resource.is_a?(Ontology) ? resource.current_version : resource html_opts = { - class: "evaluation-state", + class: + "evaluation-state label #{State::STATE_LABEL[resource.state.to_sym]}", data: { klass: resource.class.to_s, id: resource.id, @@ -44,9 +45,9 @@ def state_tag(resource) end def state(resource) - html = content_tag(:span, resource.state) + html = content_tag(:span, t("states.#{resource.state}")) - unless State::TERMINAL_STATES.include?(resource.state) + unless State::IDLE_STATES.include?(resource.state) html << " " << image_tag('spinner-16x16.gif', class: 'spinner') end diff --git a/app/models/axiom.rb b/app/models/axiom.rb index 10e8e6244..767b3d564 100644 --- a/app/models/axiom.rb +++ b/app/models/axiom.rb @@ -1,3 +1,3 @@ class Axiom < Sentence - has_many :sine_symbol_axiom_triggers + has_many :sine_symbol_axiom_triggers, dependent: :destroy end diff --git a/app/models/axiom_selection.rb b/app/models/axiom_selection.rb index ce79e7a43..69c2a8a61 100644 --- a/app/models/axiom_selection.rb +++ b/app/models/axiom_selection.rb @@ -5,7 +5,7 @@ class AxiomSelection < ActiveRecord::Base attr_accessible :finished - has_many :proof_attempt_configurations + has_many :proof_attempt_configurations, dependent: :destroy has_and_belongs_to_many :axioms, class_name: 'Axiom', association_foreign_key: 'sentence_id', diff --git a/app/models/generated_axiom.rb b/app/models/generated_axiom.rb index a25537714..d94808143 100644 --- a/app/models/generated_axiom.rb +++ b/app/models/generated_axiom.rb @@ -2,7 +2,5 @@ class GeneratedAxiom < ActiveRecord::Base belongs_to :proof_attempt attr_accessible :name - def to_s - name - end + alias_attribute :to_s, :name end diff --git a/app/models/hets_instance.rb b/app/models/hets_instance.rb index 00b91f7f3..df4af062b 100644 --- a/app/models/hets_instance.rb +++ b/app/models/hets_instance.rb @@ -60,13 +60,21 @@ def self.with_instance! result end - def self.choose! + def self.choose!(try_again: true) raise NoRegisteredHetsInstanceError.new unless any? + instance = nil Semaphore.exclusively(MUTEX_KEY) do instance = active.free.first instance ||= increment_queue! { active.force_free.load_balancing_order.first } instance ||= increment_queue! { active.busy.load_balancing_order.first } instance.try(:set_busy!) + end + if instance + instance + elsif try_again + find_each { |hets_instance| hets_instance.send(:set_up_state!) } + choose!(try_again: false) + else instance or raise NoSelectableHetsInstanceError.new end end @@ -95,6 +103,7 @@ def to_s def finish_work! reload + Sidekiq::Status.unschedule(@force_free_job_id) self.queue_size -= 1 if queue_size > 0 if queue_size > 0 set_busy! @@ -118,7 +127,8 @@ def set_force_free! def set_busy! self.state = 'busy' - HetsInstanceForceFreeWorker.perform_in(FORCE_FREE_WAITING_PERIOD, id) + @force_free_job_id = + HetsInstanceForceFreeWorker.perform_in(FORCE_FREE_WAITING_PERIOD, id) save! end diff --git a/app/models/ontology.rb b/app/models/ontology.rb index ab3906b6a..56de3e3e0 100644 --- a/app/models/ontology.rb +++ b/app/models/ontology.rb @@ -14,6 +14,7 @@ class Ontology < ActiveRecord::Base include Ontology::FileExtensions include Ontology::HetsOptions include Ontology::Import + include Ontology::ImportMappings include Ontology::Mappings include Ontology::Oops include Ontology::OwlClasses @@ -81,18 +82,6 @@ def title name? ? iri : nil end - def is_imported? - import_mappings.present? - end - - def is_imported_from_other_repository? - import_mappings_from_other_repositories.present? - end - - def imported_by - import_mappings.map(&:source) - end - def destroy_with_parent(user) if parent repository.delete_file(parent.path, user, @@ -121,15 +110,12 @@ def can_be_deleted? end def can_be_deleted_alone? - !is_imported? + !source_mappings_from_other_files.any? && + children.all?(&:can_be_deleted_alone?) end def can_be_deleted_with_whole_repository? - !is_imported_from_other_repository? - end - - def imported_ontologies - fetch_mappings_by_kind(self, 'import') + !source_mappings_from_other_repositories.any? end def contains_logic_translations? @@ -137,12 +123,6 @@ def contains_logic_translations? pluck_select([query, *args], :logically_translated).size > 1 end - def direct_imported_ontologies - ontology_ids = Mapping.where(target_id: self, kind: 'import'). - pluck(:source_id) - Ontology.where(id: ontology_ids) - end - def combined_sentences affected_ontology_ids = [self.id] + imported_ontologies.pluck(:id) Sentence.original.where(ontology_id: affected_ontology_ids) @@ -212,14 +192,4 @@ def has_file(commit_oid = nil) repository.path_exists?(path, commit_oid) end end - - protected - - def import_mappings - Mapping.where(source_id: id, kind: 'import') - end - - def import_mappings_from_other_repositories - import_mappings.select { |l| l.target.repository != repository } - end end diff --git a/app/models/ontology/hets_options.rb b/app/models/ontology/hets_options.rb index 539658b0c..75f32688b 100644 --- a/app/models/ontology/hets_options.rb +++ b/app/models/ontology/hets_options.rb @@ -3,12 +3,21 @@ module Ontology::HetsOptions # Hets has some trouble inferring those input types # by itself, so we give it a hint: - EXTENSIONS_TO_INPUT_TYPES = {'.tptp' => 'tptp', - '.p' => 'tptp'} + EXTENSIONS_TO_INPUT_TYPES = {'.p' => 'tptp'} def hets_options Hets::HetsOptions.new(:'url-catalog' => repository.url_maps, :'access-token' => repository.generate_access_token, - :'input-type' => EXTENSIONS_TO_INPUT_TYPES[file_extension]) + :'input-type' => input_type) + end + + protected + + def input_type + EXTENSIONS_TO_INPUT_TYPES[file_extension] || file_extension_without_dot + end + + def file_extension_without_dot + file_extension[1..-1] if file_extension end end diff --git a/app/models/ontology/import_mappings.rb b/app/models/ontology/import_mappings.rb new file mode 100644 index 000000000..53c2ec2fe --- /dev/null +++ b/app/models/ontology/import_mappings.rb @@ -0,0 +1,34 @@ +class Ontology + # An ontology being imported into is in this context not only a Mapping with + # kind 'import' but any kind of mapping. Otherwise the target ontology's view, + # alignment, etc. is invalid. + module ImportMappings + extend ActiveSupport::Concern + + included do + def mapping_targets + source_mappings.map(&:target) + end + + def imported_ontologies + fetch_mappings_by_kind(self, 'import') + end + + def direct_imported_ontologies + ontology_ids = Mapping.where(target_id: self, kind: 'import'). + pluck(:source_id) + Ontology.where(id: ontology_ids) + end + + def source_mappings_from_other_files + source_mappings.reject do |l| + l.target.repository == repository && l.target.path == path + end + end + + def source_mappings_from_other_repositories + source_mappings.select { |l| l.target.repository != repository } + end + end + end +end diff --git a/app/models/ontology/sentences.rb b/app/models/ontology/sentences.rb index 469b97725..ff406e8b9 100644 --- a/app/models/ontology/sentences.rb +++ b/app/models/ontology/sentences.rb @@ -155,7 +155,7 @@ def set_theorem_attributes(theorem, hash) theorem.state = 'done' else status_id = ProofStatus::DEFAULT_OPEN_STATUS - theorem.state = 'pending' + theorem.state = 'not_started_yet' end theorem.proof_status = ProofStatus.find(status_id) end diff --git a/app/models/ontology_member/symbol.rb b/app/models/ontology_member/symbol.rb index 7c93298b5..a6827ac2c 100644 --- a/app/models/ontology_member/symbol.rb +++ b/app/models/ontology_member/symbol.rb @@ -12,8 +12,9 @@ class Symbol < ActiveRecord::Base has_and_belongs_to_many :oops_responses # associations for SineAxiomSelection - has_one :sine_symbol_commonness, class_name: SineSymbolCommonness - has_many :sine_symbol_axiom_triggers + has_one :sine_symbol_commonness, class_name: SineSymbolCommonness, + dependent: :destroy + has_many :sine_symbol_axiom_triggers, dependent: :destroy attr_accessible :locid attr_accessible :label, :comment diff --git a/app/models/ontology_version/parsing.rb b/app/models/ontology_version/parsing.rb index 2f2baa390..c90c22116 100644 --- a/app/models/ontology_version/parsing.rb +++ b/app/models/ontology_version/parsing.rb @@ -7,6 +7,7 @@ module OntologyVersion::Parsing after_create :async_parse, :if => :commit_oid? attr_accessor :fast_parse + attr_accessor :files_to_parse_afterwards end def do_not_parse! @@ -18,14 +19,17 @@ def async_parse(*args) update_state! :pending if @fast_parse - async :parse_fast + OntologyParsingWorker.perform_async(id, :parse_fast, + files_to_parse_afterwards) else - async :parse_full + OntologyParsingWorker.perform_async(id, :parse_full, + files_to_parse_afterwards) end end end - def parse(refresh_cache: false, structure_only: self.fast_parse) + def parse(refresh_cache: false, structure_only: self.fast_parse, + files_to_parse_afterwards: []) update_state! :processing do_or_set_failed do @@ -39,6 +43,13 @@ def parse(refresh_cache: false, structure_only: self.fast_parse) update_state! :done end + + files_to_parse_afterwards.each do |path| + ontology_version_options = OntologyVersionOptions.new(path, self.user, + do_not_parse: false) + version = OntologySaver.new(repository). + save_ontology(commit_oid, ontology_version_options) + end end # generate XML by passing the raw ontology to Hets @@ -48,12 +59,12 @@ def generate_xml(structure_only: false) [:all_is_well, input_io] end - def parse_full - parse(structure_only: false) + def parse_full(files_to_parse_afterwards = []) + parse(structure_only: false, files_to_parse_afterwards: files_to_parse_afterwards) end - def parse_fast - parse(structure_only: true) + def parse_fast(files_to_parse_afterwards = []) + parse(structure_only: true, files_to_parse_afterwards: files_to_parse_afterwards) end def retrieve_available_provers_for_self_and_children diff --git a/app/models/oops_request/states.rb b/app/models/oops_request/states.rb index f8713899f..b24f32b6b 100644 --- a/app/models/oops_request/states.rb +++ b/app/models/oops_request/states.rb @@ -11,7 +11,6 @@ module OopsRequest::States include StateUpdater included do - async_method :run after_create :async_run, if: ->{ responses.empty? } end @@ -24,4 +23,7 @@ def run end end + def async_run + OopsRequestWorker.perform_async(id) + end end diff --git a/app/models/proof_attempt.rb b/app/models/proof_attempt.rb index f7f0d698c..769b36c3e 100644 --- a/app/models/proof_attempt.rb +++ b/app/models/proof_attempt.rb @@ -7,10 +7,10 @@ class ProofAttempt < ActiveRecord::Base belongs_to :theorem, foreign_key: 'sentence_id' belongs_to :proof_status belongs_to :prover - belongs_to :proof_attempt_configuration + belongs_to :proof_attempt_configuration, dependent: :destroy has_one :axiom_selection, through: :proof_attempt_configuration has_one :prover_output - has_one :tactic_script + has_one :tactic_script, dependent: :destroy has_many :generated_axioms, dependent: :destroy has_and_belongs_to_many :used_axioms, class_name: 'Axiom', @@ -37,16 +37,12 @@ class ProofAttempt < ActiveRecord::Base scope :latest, order('number DESC') - delegate :ontology, to: :theorem + has_one :ontology, through: :theorem def self.find_with_locid(locid, _iri = nil) where(locid: locid).first end - def used_sentences - @used_sentences ||= used_axioms + used_theorems - end - def set_default_proof_status self.proof_status ||= ProofStatus.find(ProofStatus::DEFAULT_OPEN_STATUS) end @@ -77,12 +73,4 @@ def proper_subset_of_axioms_selected? available = theorem.ontology.axioms selected.any? && selected.count < available.count end - - protected - - def prove_options_from_configuration - pac = proof_attempt_configuration - Hets::ProveOptions.new({prover: pac.prover, - timeout: pac.timeout}) - end end diff --git a/app/models/proof_attempt_configuration.rb b/app/models/proof_attempt_configuration.rb index 7b2c33a71..3906287d3 100644 --- a/app/models/proof_attempt_configuration.rb +++ b/app/models/proof_attempt_configuration.rb @@ -8,8 +8,8 @@ class ProofAttemptConfiguration < ActiveRecord::Base validates :proof_attempt, presence: true - delegate :axioms, to: :axiom_selection - delegate :ontology, to: :proof_attempt + has_many :axioms, through: :axiom_selection + has_one :ontology, through: :proof_attempt def empty? [logic_mapping, prover, timeout, axioms].all?(&:blank?) diff --git a/app/models/proof_status.rb b/app/models/proof_status.rb index 3ccb7dbba..65a80063a 100644 --- a/app/models/proof_status.rb +++ b/app/models/proof_status.rb @@ -17,6 +17,10 @@ class ProofStatus < ActiveRecord::Base :solved, :locid + alias_attribute :to_s, :identifier + alias_attribute :to_param, :identifier + alias_attribute :solved?, :solved + validates_presence_of :label before_create :generate_locid @@ -25,18 +29,6 @@ def self.find_with_locid(locid, _iri = nil) where(locid: locid).first end - def to_s - identifier - end - - def to_param - identifier - end - - def solved? - solved - end - protected def generate_locid diff --git a/app/models/proof_status/creation_from_ontology.rb b/app/models/proof_status/creation_from_ontology.rb index 37694a6e0..3561b6a28 100644 --- a/app/models/proof_status/creation_from_ontology.rb +++ b/app/models/proof_status/creation_from_ontology.rb @@ -34,7 +34,7 @@ def label(status) return nil unless label_sentence - match = label_sentence.text.match(/#hasLabel[^#]+#(?